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