Beispiel #1
0
    private void OnClientReady()
    {
        // Run on main thread to lock data and send rpc
        MainThreadManager.Run(() =>
        {
            List <Player> players = PlayerManager.Instance.GetAllPlayers();

            Player localPlayer = PlayerManager.Instance.GetLocalPlayer();
            if (localPlayer == null)
            {
                Debug.LogError("Local player not set");
            }

            PlayerDetails localPlayerDetails = localPlayer.GetPlayerDetails();
            foreach (Player player in players)
            {
                // Remove unnecessary objects/components
                player.UpdateToggleables();

                // Player reveal activates
                RevealActor revealActor = player.GetRevealActor();
                revealActor.enabled     = true;
            }

            networkObject.SendRpc(RPC_SET_CLIENT_READY, Receivers.All, localPlayerDetails.GetName());

            // Unsubscribe from playersloaded
            PlayerManager.Instance.PlayerListPopulated -= OnClientReady;
        });
    }
Beispiel #2
0
 private void Awake()
 {
     m_LocalNetworkTogglables = GetComponent <LocalNetworkTogglables>();
     m_PlayerNetworkHandler   = GetComponent <PlayerNetworkHandler>();
     m_RevealActor            = GetComponent <RevealActor>();
     m_StealthActor           = GetComponent <StealthActor>();
     m_SkillHandler           = GetComponent <SkillHandler>();
     m_HealthHandler          = GetComponent <HealthHandler>();
     m_CharacterCustomizer    = GetComponentInChildren <CharacterCustomizer>();
 }
Beispiel #3
0
    private void OnTriggerStay(Collider other)
    {
        RevealActor revealActor = other.GetComponent <RevealActor>();

        if (revealActor == null)
        {
            return;
        }

        revealActor.SetRadiusModifier(m_TargetRevealRadius);
    }