public static void SpawnPlayerEvent(Vector3 direction) { if (OnSpawnPlayer != null) { OnSpawnPlayer.Invoke(direction); } }
private IEnumerator <float> RespawnIn30(Player player) { player.ClearBroadcasts(); player.Broadcast(5, $"Respawning in {RespawnSpeed} seconds."); yield return(Timing.WaitForSeconds(RespawnSpeed)); if (Round.IsStarted && player.ReferenceHub != null && player.Role == RoleType.Spectator) { OnSpawnPlayer?.Invoke(player); } }
private void AllowTeamSpawnPatch_OnForceTeamSpawn() { var players = Player.List.ToList(); var playerCount = players.Count; for (int i = 0; i < playerCount; i++) { var player = players[i]; if (player.Role == RoleType.Spectator && !player.IsOverwatchEnabled && Round.IsStarted) { OnSpawnPlayer?.Invoke(player); } } }