//This part is stuff for Unity. It tells the code which libraries it is going to need to work. //You probably won't ever need to change this. using System.Collections; using System.Collections.Generic; using UnityEngine; //Define a class named HelloWorld. // public means that code outside of this file can see it. // MonoBehaviour is a basic Unity behavior that can be attached to objects. public class HelloWorld : MonoBehaviour { //this is an integer (number) that counts how many times we have updated. // it is set to 0 by default. int nNumUpdates = 0; //this is a string (text) that gives the object a name. // it is blank by default, but because it is public it can be changed in the editor. public string name = ""; //The Awake function is the first one that is called on startup. void Awake() { Debug.Log("Hello World! I am AWAKE!"); nNumUpdates = 0; if (!string.IsNullOrEmpty(name)) { Debug.Log("My name is " + name); } } //The Start function is called after Awake whenever the object is re-Started // Use this for initialization void Start () { Debug.Log("Hello Again World! I have STARTED!"); } // Update is called once per frame void Update () { //Only do this if we have updated 0 times (ie, if this is the first frame) if (nNumUpdates==0) { Debug.Log("How's it going World? I have UPDATED!"); } //increase the frame count nNumUpdates++; } }