Example #1
0
 void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
         ZDMap.ResetMap();
     }
 }
Example #2
0
        void Start()
        {
            if (Instance && Instance != this)
            {
                Destroy(this);
            }
            else
            {
                Instance = this;
            }

            //Initialize Static Values.
            gameState   = ZDGameState.Initialize;
            playerProps = new PlayerProps();

            //Cache Component
            audioSource = GetComponent <AudioSource>();

            //Initialize Game Resources.
            Initialize();
        }