public static void instanConsole(string message) { if (instan == null) { GameObject instanObj = Instantiate(Resources.Load("System/ConsoleDebug", typeof(GameObject))) as GameObject; instan = instanObj.GetComponent<consoleMaster>(); instan.NewMessage(message); } }
void Awake() { instan = this.gameObject.GetComponent<consoleMaster>(); DontDestroyOnLoad(this.gameObject); }