Esempio n. 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Esempio n. 2
0
    void Awake()
    {
        DontDestroyOnLoad(this.gameObject);

        if (instance1 == null)
        {
            instance1 = this;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }