ModelViewComponent.cs 908 B

12345678910111213141516171819202122232425262728293031323334
  1. using CommonLang;
  2. using UnityEngine;
  3. namespace ET.Client
  4. {
  5. [ComponentOf(typeof(Scene))]
  6. public class ModelViewComponent : Entity, IAwake, IDestroy
  7. {
  8. [StaticField]
  9. public static ModelViewComponent Instance;
  10. }
  11. [FriendOf(typeof(ModelViewComponent))]
  12. public static class ModelViewComponentSystem
  13. {
  14. [ObjectSystem]
  15. public class ModelViewComponentAwakeSystem : AwakeSystem<ModelViewComponent>
  16. {
  17. protected override void Awake(ModelViewComponent self)
  18. {
  19. ModelViewComponent.Instance = self;
  20. }
  21. }
  22. [ObjectSystem]
  23. public class ModelViewComponentDestroySystem : DestroySystem<ModelViewComponent>
  24. {
  25. protected override void Destroy(ModelViewComponent self)
  26. {
  27. ModelViewComponent.Instance = null;
  28. }
  29. }
  30. }
  31. }