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