O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Important Functions

The purpose of this appendix is to explain the meaning of some important methods used in Unity, referenced from the Unity Scripting Documentation.

Awake

The Awake function is called when the script instance is being loaded.

Awake is used to initialize any variable or game state before the game starts. It is called only once during the lifetime of the script instance. It is also called after all the objects are initialized, so you can safely speak to other objects or query them using, for example, GameObject.FindWithTag . Each Awake function of the GameObject is called in a random order between objects. Because of this, you should use Awake to set up references between scripts, and use Start to pass any information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required