コード例 #1
0
ファイル: Dispatcher.cs プロジェクト: qiqisteve/UnityToolbag
 void OnDestroy()
 {
     if (_instance == this) {
         _instance = null;
         _instanceExists = false;
     }
 }
コード例 #2
0
ファイル: Dispatcher.cs プロジェクト: qiqisteve/UnityToolbag
 void Awake()
 {
     if (_instance) {
         DestroyImmediate(this);
     }
     else {
         _instance = this;
         _instanceExists = true;
         _mainThread = Thread.CurrentThread;
     }
 }