Пример #1
0
        public IEnumerator _EndTurn()
        {
            if (GameControl.GetGamePhase() == _GamePhase.Over)
            {
                yield break;
            }

            yield return(new WaitForSeconds(0.2f));

            currentTurnID += 1;

            if (turnMode == _TurnMode.FactionPerTurn)
            {
                if (moveOrder == _MoveOrder.Free)
                {
                    FactionManager.EndTurn_FactionPerTurn();
                }
                else
                {
                    if (FactionManager.SelectNextUnitInFaction_NotFree())
                    {
                        TBTK.OnNewTurn(IsPlayerTurn());
                        yield break;
                    }
                    else
                    {
                        FactionManager.EndTurn_FactionPerTurn();
                    }
                }
            }
            else if (turnMode == _TurnMode.FactionUnitPerTurn)
            {
                CheckPlayerMoveFlag(false);
                FactionManager.EndTurn_FactionUnitPerTurn();
            }

            IterateEndTurn();
            if (turnMode == _TurnMode.UnitPerTurn)
            {
                FactionManager.EndTurn_UnitPerTurn();
            }


            TBTK.OnNewTurn(IsPlayerTurn());
        }