MessageAction.cs 391 B

1234567891011121314151617181920
  1. using Common.Event;
  2. using Model;
  3. using MongoDB.Bson;
  4. namespace Controller
  5. {
  6. [Action(ActionType.MessageAction)]
  7. public class MessageAction : IEventSync
  8. {
  9. public void Run(Env env)
  10. {
  11. Unit unit = World.Instance.GetComponent<UnitComponent>().Get(ObjectId.Empty);
  12. if (unit == null)
  13. {
  14. return;
  15. }
  16. unit.GetComponent<ActorComponent>().Add(env);
  17. }
  18. }
  19. }