Exemple #1
0
    // Called when Join Voice Call button is pressed. Calls all the players already in the VC.
    public void JoinPeerJSSession()
    {
        PlayerEntry self = gamestateTracker.players.Get((short)PhotonNetwork.LocalPlayer.ActorNumber);

        self.isInVC = true;
        self.Increment();
        gameObject.GetComponent <Button>().interactable            = false;
        gameObject.GetComponentInChildren <TextMeshProUGUI>().text = "Joined Call";
        for (int i = 0; i < gamestateTracker.players.count; i++)
        {
            PlayerEntry player = gamestateTracker.players.GetAtIndex(i);
            if (player.id != PhotonNetwork.LocalPlayer.ActorNumber && player.isInVC)
            {
                string callerID = PhotonNetwork.CurrentRoom.Name + player.id.ToString();
                callA(callerID);
            }
            player.Release();
        }
    }