public static UnitController CreateUnit(float posX, float posY, UnitTypes unit) { UnitController newUnitController = null; try { newUnitController = new UnitController(posX, posY, unit); RegisterUnit(newUnitController); //Debug.Log(String.Format("UnitController created at {0}x{1}", posX, posY)); } catch (Exception e) { //Debug.Log(String.Format("There was an error creating UnitController at location {0}x{1}", posX, posY)); } return newUnitController; }
public static void RegisterUnit(UnitController unitController) { Units.Add(unitController); }
public UnitView(Unit owner, UnitTypes unitType) { _owner = owner; _unit = GuiAPI.CreateUnit(UnitPosition.x, UnitPosition.y, unitType); }