コード例 #1
0
 private void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #2
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
     GamePlayerCtrl.Instance.Event_Over_Game += Reset;
     Init_Key();
 }