Esempio n. 1
0
 //回傳是否碰到炸彈 得到->true 沒得到->false
 private bool GetBombOrNot(int playerID)
 {
     if (_mapData.getBombPos().Exists(Point => Point.x == _mapData.getPlayerPos(playerID).x&& Point.y == _mapData.getPlayerPos(playerID).y))
     {
         int BombID = _mapData.getBombPos().FindIndex(Point => Point.x == _mapData.getPlayerPos(playerID).x&& Point.y == _mapData.getPlayerPos(playerID).y);
         _boomTimer     += Time.deltaTime;
         _moveState.text = "Boom";
         _bomb[BombID].SetActive(true);
         _boomTip.transform.localPosition = new Vector3(292, -120, -1);
         this.BlowUp(_boomTip, _boomTimer);
         if (_boomTimer > _boomTriggerTime)
         {
             _boomTimer = 0f;
             _mapData.removeBomb(BombID);
             _bomb[BombID].transform.Translate(0, 0, 2);
             _bomb[BombID].SetActive(false);
             BoomPosInit();
             _boomTip.transform.localPosition = new Vector3(500, -500, 10);
             return(true);
         }
     }
     return(false);
 }