Unity3D, editable global variables?
问题 As far as I know, the only possibility to use global variables is to define them as static (const in C#). Is there any way to access and change a variable from another script, while both scripts access the same variable? 回答1: It depends on the situation and your requirements. In most cases there are several ways to go. If both scripts are derived from MonoBehaviour and are active you can take non-static public members and use GameObject.Find (store it as reference if you need it quite often