| 1234567891011121314151617181920 |
- using UnityEngine;
- namespace ET
- {
- public static class UnitFactory
- {
- public static Unit Create(Entity domain, long id)
- {
- Unit unit = EntityFactory.CreateWithId<Unit>(domain, id);
-
- unit.AddComponent<TurnComponent>();
- Game.EventSystem.Publish(new EventType.AfterUnitCreate() {Unit = unit});
-
- UnitComponent unitComponent = Game.Scene.Get(0).GetComponent<UnitComponent>();
- unitComponent.Add(unit);
- return unit;
- }
- }
- }
|