SessionComponent.cs 524 B

123456789101112131415161718192021222324252627282930313233343536
  1. namespace ET
  2. {
  3. public class SessionComponentAwakeSystem : AwakeSystem<SessionComponent>
  4. {
  5. public override void Awake(SessionComponent self)
  6. {
  7. self.Awake();
  8. }
  9. }
  10. public class SessionComponent: Entity
  11. {
  12. public static SessionComponent Instance;
  13. public Session Session;
  14. public void Awake()
  15. {
  16. Instance = this;
  17. }
  18. public override void Dispose()
  19. {
  20. if (this.IsDisposed)
  21. {
  22. return;
  23. }
  24. base.Dispose();
  25. this.Session.Dispose();
  26. this.Session = null;
  27. Instance = null;
  28. }
  29. }
  30. }