UnitFactory.cs 404 B

1234567891011121314151617
  1. using Model;
  2. namespace Controller
  3. {
  4. [Factory(typeof (Unit), UnitType.GatePlayer)]
  5. public class UnitGatePlayerFactory: IFactory<Unit>
  6. {
  7. public Unit Create(int configId)
  8. {
  9. Unit player = new Unit(configId);
  10. player.AddComponent<BuffComponent>();
  11. player.AddComponent<ActorComponent>();
  12. World.Instance.GetComponent<UnitComponent>().Add(player);
  13. return player;
  14. }
  15. }
  16. }