Notes on Unity framework for game design

Public variables are accessible from within the Unity editor, meaning they can be adjusted by non-coders.

Depending on what variable is exposed, the Unity editor will show fields that you can fill in with components from your hierarchy.

Every script in Unity derives from the MonoBehaviour class. The inherited functions include:

  • transform
    • contains Transform component
  • GetComponent
    • access a component of the GameObject.

Exposing a variable also let's you instantiate it from within the Unity Editor, after for example attaching the script to a Prefab as a component.

Also see unity shaders