Пример #1
0
        public static void UnSummonAllUnit()
        {
            List <Unit> units = BattleManager.instance.AllUnits;

            for (int i = units.Count - 1; i >= 0; i--)
            {
                Unit unit = units[i];
                if (unit.Alliance == UnitAlliance.Party)
                {
                    GameManager.RemovePartyUnit(unit); //죽으면 파티유닛에서 박탈.
                }
                BattleView.DestroyUnitObject(unit);
                BattleManager.instance.AllUnits.Remove(unit);
                FieldManager.GetTile(unit.Position).OffTile();
            }
            BattleManager.instance.AllUnits.Clear();
        }
Пример #2
0
        public static void UnSummon(this Unit unit)
        {
            if (unit.Alliance == UnitAlliance.Party)
            {
                GameManager.RemovePartyUnit(unit); //죽으면 파티유닛에서 박탈.
            }
            FieldManager.GetTile(unit.Position).OffTile();

            BattleView.DestroyUnitObject(unit);
            BattleManager.instance.AllUnits.Remove(unit);
            BattleManager.instance.InitializeUnitBuffer();

            // 유닛 소환해제시 DownStair Button 활성화 검사
            // Model.Tiles.DownStair.CheckPartyDownStair();

            //적 전멸 -> (승리조건 검사 목적), 내가 죽음 -> (턴을 다음 유닛으로 넘길 목적)
            if (GameManager.InBattle)
            {
                if (BattleManager.GetUnit(UnitAlliance.Enemy).Count == 0)
                {
                    BattleController.instance.ThisTurnEnd();
                }

                else if (BattleManager.instance.thisTurnUnit == unit)
                {
                    BattleManager.instance.thisTurnUnit = null;
                    BattleController.instance.ThisTurnEnd();
                }
            }

            //비전투시 유닛 표시기 비활성화
            else if (BattleManager.instance.thisTurnUnit == unit)
            {
                BattleManager.instance.thisTurnUnit = null;
            }
        }