protected override void OnDestroy() { Instance?.Unsubscribe(nameof(Instance.CanNetworkTo)); Facepunch.Pool.FreeList(ref remainingSlashers); EventPlayers.Clear(); base.OnDestroy(); }
internal override void LeaveEvent(BasePlayer player) { bool isSlasher = slasherPlayer != null && player.GetComponent <SlasherPlayer>() == slasherPlayer; EventPlayers.Remove(player); base.LeaveEvent(player); if (isSlasher && Status != EventManager.EventStatus.Finished) { EndRound(); } }
protected override void StartEvent() { base.StartEvent(); Instance.Subscribe(nameof(Instance.CanNetworkTo)); rounds = eventPlayers.Count; remainingSlashers.AddRange(eventPlayers); EventPlayers.Clear(); EventPlayers.AddRange(eventPlayers.Select((EventManager.BaseEventPlayer eventPlayer) => eventPlayer.Player)); StartRound(); }