Test unity for debug my script C#



Hay gusy im back for discussing about making a game. lets make simple script for just test.
Oke now i want make a script for make text "Hello World", in older article you have train about C# for create "hello world" at console, but now i want learn to using mono develop for unity. you able to use visual studio too, but in unity has been mono develop, so i use that.

 First we can make new project you can see below.



Then in project on assets i want make new folder scripts, to make it spruce. by right click > create > folder > and give name "Script", so in folder script i create new code script for csharp by name "Script_01_Hello_World" oke in make nick name dont use 'space or caracter' like "Script 01 ..." oke iam done. Then double click so automatic opened mono develop.



You see.
If loading it done now you will see default a code in mono develop for unity.
There write void Start and Update. What is diferent of both? so if you write code in Start you just show code when the script is call, then if write code in Update your code is update after call so simple but have more void other Update and Start is :
1.void Awake. this call bevore script it call
2.void LateUpdate. this call for make update be smooth. Usuly to regulate camera.
3.void FixedUpdate. this for make update be fixed not make looping.

oke now lets start make debug code
you can write Debug.Log("Hello World"); inner void start



After that save the script it automatic update in unity, you can see code in inspector by click script. If you see its same what you write, now we can tested the script in main camera on hirarcry by click then drag drop in inspector your script or manual by adding component = > scripts=> then choice your script. Done you can tested by clicked run a game, and look in console what happend.



Oke maybe for more disscusion i want share new article in next day. so just save this first train using unity for more train script write in unity for making a game. thank you for visiting here dont forget to read articles in here see yaa.

0 Response to "Test unity for debug my script C#"

Post a Comment

Relevan Untuk Anda

Powered by Blogger.