SessionComponentSystem.cs 578 B

12345678910111213141516171819202122
  1. namespace ET
  2. {
  3. public class SessionComponentDestroySystem: DestroySystem<SessionComponent>
  4. {
  5. public override void Destroy(SessionComponent self)
  6. {
  7. self.AccountSession?.Dispose();
  8. self.GateSession?.Dispose();
  9. }
  10. }
  11. public static class SessionComponentComponent
  12. {
  13. public static void Disconnect(this SessionComponent self)
  14. {
  15. self.AccountSession?.GetComponent<DisConnectedCompnent>()?.CancelAlert();
  16. self.AccountSession?.Dispose();
  17. self.GateSession?.GetComponent<DisConnectedCompnent>()?.CancelAlert();
  18. self.GateSession?.Dispose();
  19. }
  20. }
  21. }