Home > other >  Inquire how to write the following c # script
Inquire how to write the following c # script

Time:09-26

Create a new c # script called HelloWorld that every frame increments an int variable by 1 in the Update () method and prints it to the console using the Debug. The Log (), starting with 0.
? Attach this to the script Empty2 and press the Play button to see the output in the Console window.
To create a new c # called HelloWorld script, the script in the Update () method of each frame will be an int variable to add 1, and then use the Debug. The Log () starting from 0 to be printed to the console,
? Attach it to the script Empty2, then press "play" button to view the output in the console window,

CodePudding user response:

int index=0;
Index++;
The debug log (index)

CodePudding user response:

 
Public class HelloWorld: MonoBehaviour
{
Private int theVariable=0;

Private void the Update ()
{
The Debug log (theVariable + +);
}
}
  • Related