코딩메모
-
팀 스파르타 4주차 코딩메모코딩메모 2022. 9. 30. 00:13
gameManager.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; // UI엔진 업데이트 using System.Linq; public class gameManager : MonoBehaviour { public Text timeTxt; // 외부에서 텍스트 타입의 '타임텍스트' 요청 public GameObject card; // 외부에서 게임 오브젝트 '카드' 요청 float time; // 소수점 타임 선언 public static gameManager I; // 싱글톤화 public GameObject firstCard; // 두가지를 비교하기 위해 F카드와..
-
팀 스파르타 3주차 코딩메모코딩메모 2022. 9. 27. 00:00
cat.cs using System.Collections; using System.Collections.Generic; using UnityEngine; public class cat : MonoBehaviour { float full = 5f; // full 선언 float energy = 0f; // energy 선언 bool isFull = false; // isFull의 값이 기본적으로 거짓이다 (평소엔 고양이가 배가 부르지 않다) public int type; // 타입이라는 정수 퍼블릭 선언 // Start is called before the first frame update void Start() { float x = Random.Range(-8.5f, 8.5f); // x 값은 -8.5에..
-
팀 스파르타 2주차 코딩메모코딩메모 2022. 9. 23. 02:34
gameManager.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; // UI로 텍스트를 받기 using UnityEngine.SceneManagement; // Scene 새로고침을 위해 해당 기능을 불러옴 public class gameManager : MonoBehaviour { public GameObject Square; // 외부에 게임 오브젝트인 "Square" 요청 public GameObject endPanel; // 외부에 게임 오브젝트인 "endPanel" 요청 public Text timeTxt; // 외부에 텍스트 타입인 "timeTxt" 요청..
-
코딩 메모/ 이번회차는 메인 캐릭터에만 메모코딩메모 2022. 9. 21. 20:41
using System.Collections; using System.Collections.Generic; using UnityEngine; public class rtan : MonoBehaviour { float direction = 0.05f; float toward = 1.0f; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { //Debug.Log(transform.position.x);//디버깅용 코드 디버그 후엔 삭제해도 무관 if (Input.GetMouseButtonDown(0)) { toward *= -1; direction *=..