Hi, I'm completely new to C Sharp so this is probably an easy question to most of you!
public class Social : MonoBehaviour
GameObject cameraGO = GameObject.Find("Main Camera");
MainMenuGUI mainMenuGUI = cameraGO.GetComponent<MainMenuGUI>();
Thanks for any help!
Static variables are accessed like this:
className.variableName; if you have classes
Well you don't have to declare the mainMenuGUI to access the static variable.
You just have to call the class and then the variable like so
public static string thisIsAStaticVariable = "This is a static variable";
I hope you understand otherwise this might explain it better http://msdn.microsoft.com/en-us/library/98f28cdx.aspx
Why? Check these links:
See the docs about script compilation order.