Esempio n. 1
0
        void Awake()
        {
            if (_instance == null)
            {
                _instance = this;
                //we're probably creating a new object after having explicitly destroyed, so reset.
                _destroyed = false;
                DontDestroyOnLoad(this);
            }

            if (_instance != this)
                Destroy(this);
        }
Esempio n. 2
0
        void Awake()
        {
            if (_instance == null)
            {
                _instance = this;
                //we're probably creating a new object after having explicitly destroyed, so reset.
                _destroyed = false;
                DontDestroyOnLoad(this);
            }

            if (_instance != this)
            {
                Destroy(this);
            }
        }