회원 로그인
|
출력 Debug.Log
출력 - Debug.Log
이렇게 해서 변수는 값이 바뀔 수 있다.
//예제 1 using UnityEngine; using System.Collections; public class sample : MonoBehaviour { //1. 전역 변수로 int indexNumber = 10; 입력 int indexNumber = 10; // Use this for initialization void Start () { //2. Start() 함수 안에 Debug.Log (indexNumber); 입력 Debug.Log (indexNumber); } // Update is called once per frame void Update () { } }3. 저장 후 유니티로 가서 게임 실행하면 콜손 창에 10 출력
게임 실행 중에 게임 오브젝트를 수정 금지!! 수정한 것이 원래대로 됨, 항상 게임 실행 중지하여 수정해야 함 |
//예제 2 using UnityEngine; using System.Collections; public class sample : MonoBehaviour { int indexNumber = 10; // Use this for initialization void Start () { //1. indexNumber 값을 바꿔기 위해 Start() 함수 안에 indexNumber 변수에 20을 입력 indexNumber = 20; Debug.Log (indexNumber); } // Update is called once per frame void Update () { } }2. 저장 후 유니티로 가서 게임 실행하면 콜손 창에 20 출력
댓글 0개
| 엮인글 0개
146개(1/8페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
유니티 강좌 모음(영문) | 푸딩뱃살 | 61724 | 2013.08.28 12:02 | |
유니티 경고, 에러 모음 (재정리 예정) [1+1] | 푸딩뱃살 | 73161 | 2013.08.12 00:09 | |
144 | [콘솔] 오류 : ~ multicast group | 푸딩뱃살 | 1129 | 2019.09.04 00:23 |
143 | [콘솔] 오류 : NullReferenceException | 푸딩뱃살 | 1140 | 2019.07.23 00:26 |
142 | [유니티] Unite Seoul 2019 다시보기 | 푸딩뱃살 | 1285 | 2019.06.28 10:00 |
141 | [정보] GDC 2019 유니티 키노트 하이라이트 | 푸딩뱃살 | 1390 | 2019.03.26 10:45 |
140 | [유니티] Unite Seoul 2018 아젠다 & 세션 다시보기 | 푸딩뱃살 | 2775 | 2018.05.25 10:32 |
139 | [VR/AR] Stereo 360 Image and Video Capture | 푸딩뱃살 | 2067 | 2018.02.02 10:53 |
138 | [VR/AR] ARKit - Face Tracking | 푸딩뱃살 | 1810 | 2018.01.17 16:57 |
137 | [참고] ADAM :Making 참고 | 푸딩뱃살 | 2058 | 2017.12.04 11:14 |
136 | [정보] ARKit Face Tracking on iPhone X | 푸딩뱃살 | 3170 | 2017.11.08 09:59 |
135 | [VR/AR] Vive Full Body Tracking Demo | 푸딩뱃살 | 2171 | 2017.10.31 18:54 |
134 | [애셋] 유니티 모델링 - UModeler | 푸딩뱃살 | 2214 | 2017.10.20 14:02 |
133 | [유니티] 맥에서 안드로이드/자바 SDK 경로 | 푸딩뱃살 | 3357 | 2017.10.04 23:58 |
132 | [콘솔] 오류 : Fatal Error! The project is on case sensitive file | 푸딩뱃살 | 2817 | 2017.10.01 19:59 |
131 | [참고] Adam (Made with Unity) | 푸딩뱃살 | 2535 | 2017.10.01 18:33 |
130 | [정보] 보안 패치 | 푸딩뱃살 | 1946 | 2017.08.21 15:59 |
129 | [콘솔] 오류: Failed to load '.dll', ...... | 푸딩뱃살 | 2127 | 2017.08.20 00:57 |
128 | [콘솔] 오류: [VRDevice] Initialization of device oculus failed. | 푸딩뱃살 | 1970 | 2017.08.19 03:05 |
127 | [콘솔] 오류: MissingComponentException | 푸딩뱃살 | 3001 | 2017.08.19 02:05 |
126 | [콘솔] 오류: Android Manifests | 푸딩뱃살 | 2772 | 2017.08.18 03:01 |
125 | [VR/AR] Google VR SDK for Unity | 푸딩뱃살 | 3589 | 2017.08.18 00:10 |