UnitPlayerFactory.cs 317 B

123456789101112131415
  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 gatePlayer = new Unit(configId);
  10. World.Instance.GetComponent<UnitComponent>().Add(gatePlayer);
  11. return gatePlayer;
  12. }
  13. }
  14. }