public class Script2 : MonoBehaviour {
Script1 otherScript;
void Awake() {
//If on same object:
otherScript = this.GetComponent<Script1>();
//If on object "_OtherObj"...
//Will complaing if _OtherObj doesn't exist
otherScript = GameObject.Find("_OtherObj").GetComponent<Script1>();
//In either case, check it worked...
if(otherScript == null) {Debug.LogWarning("Couldn't find otherScript");}
}
Voidvoid Start() {
otherScript.status = "First test";
otherScript.Test();
otherScript.status = "Second test";
otherScript.Test();
}
}
Any script variables you make public (like status) above) will be surfaced in the Unity editor's Inspector when you select the object.