コード例 #1
0
 private void OnDestroy()
 {
     if (current == this)
     {
         current = null;
     }
 }
コード例 #2
0
 private void Awake()
 {
     if (current && current != this)
     {
         Debug.LogError("PCG Main have to be singleton!");
         DestroyImmediate(gameObject);
     }
     current = this;
 }