コード例 #1
0
 void Awake()
 {
     if (s_instance == null)
     {
         s_instance = this;
     }
     else
     {
         if (s_instance != this)
         {
             Destroy(gameObject);
         }
     }
 }
コード例 #2
0
 void Awake()
 {
     if (s_instance == null) {
         s_instance = this;
     }
     else {
         if (s_instance!=this) {
             Destroy(gameObject);
         }
     }
 }