public static OutDebug Init() { lock (_lock) { if (Instance == null) { GameObject outDebug = GameObject.Find("OutDebug"); if (outDebug == null) { outDebug = new GameObject("OutDebug"); GameObject.DontDestroyOnLoad(outDebug); Instance = outDebug.AddComponent <OutDebug>(); } else { Instance = outDebug.GetComponent <OutDebug>(); } mCurrThreadId = Thread.CurrentThread.ManagedThreadId; } return(Instance); } }
protected override void OnAwake() { base.OnAwake(); OutDebug.Init(); }