Esempio n. 1
0
 public static void SpawnPlayerEvent(Vector3 direction)
 {
     if (OnSpawnPlayer != null)
     {
         OnSpawnPlayer.Invoke(direction);
     }
 }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        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);
                }
            }
        }