namespace ET { public class SessionComponentDestroySystem: DestroySystem { public override void Destroy(SessionComponent self) { self.Session.Dispose(); } } public static class SessionComponentComponent { public static void Disconnect(this SessionComponent self) { self.Session?.GetComponent()?.CancelAlert(); self.Session?.Dispose(); } } }