UnitFactory.cs 350 B

123456789101112131415
  1. using Model;
  2. namespace Controller
  3. {
  4. [Factory(typeof (Unit), UnitType.Player)]
  5. public class UnitPlayerFactory: IFactory<Unit>
  6. {
  7. public Unit Create(int configId)
  8. {
  9. Unit player = new Unit(configId);
  10. player.AddComponent<BuffComponent>();
  11. return player;
  12. }
  13. }
  14. }