EventData.cs 704 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /// <summary>
  5. /// 实现消息的实体
  6. /// </summary>
  7. public class EventData
  8. {
  9. public EventID ID;
  10. public EventData(EventID id)
  11. {
  12. this.ID = id;
  13. }
  14. public void Send()
  15. {
  16. if (EventManager.Instance != null) EventManager.Instance.SendEvent(this);
  17. }
  18. public static EventData CreateEvent(EventID eventid)
  19. {
  20. EventData data = new EventData(eventid);
  21. return data;
  22. }
  23. }
  24. public class EventData1 : EventData
  25. {
  26. public GameObject SelectObj;
  27. public EventData1(EventID id, GameObject obj) : base(id)
  28. {
  29. ID = id;
  30. SelectObj = obj;
  31. }
  32. }