//将战斗单位放置入战场 private void EnterBattleField() { //队伍进入战场 for (int i = 0; i < teams.Count; ++i) { //队伍进入战场 teams[i].EnterBattleField(this, battleMap.GetBornGrid(i, teams[i].battleUnits.Count, true)); } //随机行动顺序 bool reverse = DebugHelper.Instance.randomFirstAction && (resetTimes & 1) == 0; for (int i = 0; i < teams.Count; ++i) { int teamIdx = reverse ? 1 - i : i; //随机 List <BattleUnit> shuffle = new List <BattleUnit>(teams[teamIdx].battleUnits); UtilityHelper.Shuffle <BattleUnit>(shuffle); for (int j = 0; j < shuffle.Count; j++) { actionQueue.Enqueue(shuffle[j]); } } }