コード例 #1
0
ファイル: GuiAPI.cs プロジェクト: Wailord/TimeDefender
 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;
 }
コード例 #2
0
ファイル: GuiAPI.cs プロジェクト: Wailord/TimeDefender
 public static void RegisterUnit(UnitController unitController)
 {
     Units.Add(unitController);
 }
コード例 #3
0
ファイル: UnitView.cs プロジェクト: Wailord/TimeDefender
        public UnitView(Unit owner, UnitTypes unitType)
        {
            _owner = owner;

            _unit = GuiAPI.CreateUnit(UnitPosition.x, UnitPosition.y, unitType);
        }