コード例 #1
0
 private void Awake()
 {
     if (Instancia != null && Instancia != this)
     {
         gameObject.SetActive(false);
         return;
     }
     Instancia = this;
     DontDestroyOnLoad(gameObject);
 }
コード例 #2
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
         return;
     }
     Instance = this;
     DontDestroyOnLoad(gameObject);
 }