Esempio n. 1
0
        public void PlantBomb()
        {
            if (Bomb1Num + Bomb2Num + Bomb3Num == 0)
            {
                return;
            }

            if (Bomb3Num > 0)
            {
                if (BombPlanter.TryPlant(Cell, new Bomb3(Cell.X + GameData.XStandartOffset,
                                                         Cell.Y + GameData.YStandartOffset)))
                {
                    Bomb3Num--;
                }
            }
            else if (Bomb2Num > 0)
            {
                if (BombPlanter.TryPlant(Cell, new Bomb2(Cell.X + GameData.XStandartOffset,
                                                         Cell.Y + GameData.YStandartOffset)))
                {
                    Bomb2Num--;
                }
            }
            else
            {
                if (BombPlanter.TryPlant(Cell, new Bomb1(Cell.X + GameData.XStandartOffset,
                                                         Cell.Y + GameData.YStandartOffset)))
                {
                    Bomb1Num--;
                }
            }
        }
Esempio n. 2
0
 private void Start()
 {
     stunValue = 0;
     _ds       = GetComponent <DualShock4Input>();
     _myPos    = transform.position;
     _rScore   = FindObjectOfType <RoundScoring>();
     _bPlanter = GetComponent <BombPlanter>();
     _audio    = GetComponent <AudioController>();
 }