Public variables

From ETC Public Wiki
Revision as of 12:41, 5 May 2011 by Wchan1 (talk) (Created page with ''''Overview ''' ---- *Public variables are very useful in Unity. <br> *Once you declared a variable public in script, you can access it through the editor.<br> *If your public va…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview


  • Public variables are very useful in Unity.
  • Once you declared a variable public in script, you can access it through the editor.
  • If your public variable is a component object, you can also drag and drop the component to the script through the editor.
  • However, any initial value for the public variable will be overridden by the editor.
  • You would have to initialize it in the start function. For it to not be overridden by the value in the editor.