-
What is the cleanest way to set up an entry point (for code)? Currently I made an empty GameObject, then created a Javascript asset which I dragged and dropped onto the empty GameObject (so I don’t have code on multitudes of seperate GameObjects).
-
How do I set up the main entry point as a Class?
-
Is there a hot-key that will go to the definition of a method?
-
How can I see the super-class of GameObject? (I’m pretty sure that the Update() function is overriding it and I want to know what other methods there are to override.
1 2) When gameobjects come into existence (at the start of your game, when a new level is loaded, when you instance a prefab, etc.) all new gameobjects have their “Awake” handler called, then after all Awake handlers have been called, all new gameobjects have their “Start” handler called, after all Start handlers have been called, their ‘Update’ handlers get called repeatedly.
Note, the order in which gameobject have handlers called can vary from run to run.
-
Not in the editor that come with Unity for MacOS; I’m not sure about the editor used under Windows.
-
To attach a script to a gameobject, the script has to extend/inherit from the MonoBehaviour class. All info about the class, and the overrideble events can be seen here
Thank you for the reply.
I have two more questions, is there any place where I can see examples of skeleton code and often used features?
Also does the application run faster in Javascript than C#?