SessionWrapComponent.cs 585 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using ETModel;
  2. namespace ETHotfix
  3. {
  4. [ObjectSystem]
  5. public class SessionComponentAwakeSystem : AwakeSystem<SessionWrapComponent>
  6. {
  7. public override void Awake(SessionWrapComponent self)
  8. {
  9. self.Awake();
  10. }
  11. }
  12. public class SessionWrapComponent: Component
  13. {
  14. public static SessionWrapComponent Instance;
  15. public SessionWrap Session;
  16. public void Awake()
  17. {
  18. Instance = this;
  19. }
  20. public override void Dispose()
  21. {
  22. if (this.IsDisposed)
  23. {
  24. return;
  25. }
  26. base.Dispose();
  27. this.Session.Dispose();
  28. this.Session = null;
  29. Instance = null;
  30. }
  31. }
  32. }