コード例 #1
0
 private void OnDestroy()
 {
     if (this == instance)
     {
         instance = null;
     }
 }
コード例 #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         initControllers();
     }
     else
     {
         Destroy(this.gameObject);
     }
 }