public static void ResetControllers() { CountryController.ResetController(); UnitController.ResetController(); BuyingController.ResetController(); mapController.ResetController(); }
private void AddUnits(List <Unit> units, Side side, UnitUIType permitedUnits = (UnitUIType)7) { foreach (var unit in units) { if ((unit.unityUIType & permitedUnits) == permitedUnits) { continue; } Transform parent = null; if (side == Side.Blue) { parent = blueCanvases[unit.unityUIType].transform; blueCount[unit.unityUIType] += 1; } else { parent = redCanvases[unit.unityUIType].transform; redCount[unit.unityUIType] += 1; } GameObject slot = Instantiate(unitSlot.gameObject, parent); UnitIcon icon = slot.GetComponent <UnitIcon>(); icon.UnitSelected += () => BuyingController.SelectUnit(unit); icon.SetStats(unit.name, unit.icon, unit.hitPoints, unit.movement, unit.damage, unit.secondaryDamage, unit.range, unit.capacity, unit.price); allUnits.Add(unit, icon); } }