public List <ScenarioLua.Army> GetSymmetryArmies(ScenarioLua.Army army) { var allArmies = GetAllScenarioArmies(false); string armyName = army.Name; SaveLua.Marker ArmyMarker = SaveLua.GetMarker(armyName); List <ScenarioLua.Army> ToReturn = new List <ScenarioLua.Army>(); if (ArmyMarker == null) { return(ToReturn); } for (int i = 0; i < Selection.SelectionManager.Current.SymetrySelection.Length; i++) { GameObject foundMarker = Selection.SelectionManager.Current.SymetrySelection[i].FindBestSymmetry(ArmyMarker.MarkerObj.gameObject); if (foundMarker == null) { continue; } Markers.MarkerObject markerObject = foundMarker.GetComponent <Markers.MarkerObject>(); if (markerObject == null) { continue; } if (foundMarker.name == armyName) { continue; } for (int a = 0; a < allArmies.Count; a++) { if (allArmies[a].Name == foundMarker.name) { if (!ToReturn.Contains(allArmies[a])) { ToReturn.Add(allArmies[a]); } break; } } } return(ToReturn); }
public void RegisterArmyChange(MapLua.ScenarioLua.Army Army) { HistoryArmyChange.CurrentArmy = Army; HistoryArmyChange.GenerateUndo(Prefabs.ArmyChange).Register(); }