コード例 #1
0
ファイル: UnityEngineHook.cs プロジェクト: traleven/PNet
        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);
        }
コード例 #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);
            }
        }