void UpdateSoldiersInPlanets() { DebugInConsole.Log("刷新星球内士兵..."); DebugInConsole.LogFormat("敌我士兵总数: {0}", Soldiers.Length); foreach (var p in Planets) { p.Planet_.PlayerSoldiers.Clear(); p.Planet_.EnemySoldiers.Clear(); } foreach (var s in Soldiers) { switch (s.Bloc) { case SoldierType.Player: if (s.InPlanet != null) { s.InPlanet.PlayerSoldiers.Add(s); } break; case SoldierType.Enemy: if (s.InPlanet != null) { s.InPlanet.EnemySoldiers.Add(s); } break; default: break; } } }
void UpdateSituationInEachPlanet() { //_situationUpdateTimer.Resume(); _situationUpdateTimer.Update(); if (_situationUpdateTimer.CurrentState == TimerState.FINISHED) { DebugInConsole.LogFormat("*******************第{0}秒*******************", _updateCountIndex++); // UpdateSoldiersInPlanets(); //UpdatePopulation(); foreach (var p in _planets) { DebugInConsole.LogFormat("*****星球: {0}*****", p.name); p.OnUpdateSituation(); p.OnUpdateSoldierAnimation(); DebugInConsole.Log("*******************"); } DebugInConsole.LogFormat("*********************************************"); //yield return new WaitForSeconds(Formula.CalculatePerTime); //} } }