Exemplo n.º 1
0
        void Awake()
        {
            if (instance == null)
            {
                DontDestroyOnLoad(this.gameObject);
                instance = this;
                state = Enums.GameStates.Running;
                prevState = Enums.GameStates.Running;
                musicVol = .3f;
                sfxVol = .3f;
                if (FileExists())
                    Load();
                else
                {
                    //weapons = new Enums.BulletTypes[] { Enums.BulletTypes.Pistol, Enums.BulletTypes.Destroyer, Enums.BulletTypes.Malloc, Enums.BulletTypes.Free, Enums.BulletTypes.Launcher };
                    weapons = new Enums.BulletTypes[] { Enums.BulletTypes.Pistol };
                    Store();
                }

            }
            else if (this != instance)
            {
                Destroy(this.gameObject);
            }
        }
Exemplo n.º 2
0
 void Awake()
 {
     if(instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
     }
     else if(this != instance)
     {
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 3
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
         state = Enums.GameStates.Running;
         prevState = Enums.GameStates.Running;
         musicVol = .5f;
         sfxVol = .5f;
         weapons = new Enums.BulletTypes[] { Enums.BulletTypes.Pistol };
     }
     else if (this != instance)
     {
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
         state = Enums.GameStates.CardSelection;
         prevState = Enums.GameStates.CardSelection;
         musicVol = .5f;
         sfxVol = .5f;
         player1Win = false;
         player1Lose = false;
     }
     else if (this != instance)
     {
         Destroy(this.gameObject);
     }
 }