public void Destroy() { if (IsDestroyed) { return; } IsDestroyed = true; // Remove players foreach (var member in membersList.Values.ToList()) { RemovePlayer(member.Extension); } if (GameSpawnTask != null) { GameSpawnTask.OnStatusChangedEvent -= OnSpawnServerStatusChanged; GameSpawnTask.KillSpawnedProcess(); } if (OnDestroyedEvent != null) { OnDestroyedEvent.Invoke(this); } }
public void Destroy() { if (OnDestroyedEvent != null) { OnDestroyedEvent.Invoke(this); } unconfirmedAccesses.Clear(); // Clear listeners OnPlayerJoinedEvent = null; OnPlayerLeftEvent = null; OnDestroyedEvent = null; }
private void Destroyed() { OnDestroyed(); OnDestroyedEvent?.Invoke(this); }