Example #1
0
        public void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
        {
            GameObject button = Instantiate(buttonPrefab);

            button.transform.SetParent(parent, false);
            button.transform.SetSiblingIndex(newPlayer.ID);
            PushToTalkPrivateButton script = button.GetComponentInChildren <PushToTalkPrivateButton>();

            script.SetAudioGroup(newPlayer);
            buttons.Add(newPlayer.ID, script);
        }
        public void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
        {
            if (buttons.ContainsKey(newPlayer.ID))
            {
                Debug.LogWarningFormat(buttons[newPlayer.ID].gameObject, "PTT Button already added for player number {0}", newPlayer.ID);
                return;
            }
            GameObject button = Instantiate(buttonPrefab);

            button.transform.SetParent(parent, false);
            button.transform.SetSiblingIndex(newPlayer.ID + 1);
            PushToTalkPrivateButton script = button.GetComponentInChildren <PushToTalkPrivateButton>();

            script.SetAudioGroup(newPlayer);
            buttons.Add(newPlayer.ID, script);
        }
Example #3
0
        // Token: 0x0600248A RID: 9354 RVA: 0x000B26AC File Offset: 0x000B08AC
        public void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
        {
            if (this.buttons.ContainsKey(newPlayer.ID))
            {
                Debug.LogWarningFormat(this.buttons[newPlayer.ID].gameObject, "PTT Button already added for player number {0}", new object[]
                {
                    newPlayer.ID
                });
                return;
            }
            GameObject gameObject = Object.Instantiate <GameObject>(this.buttonPrefab);

            gameObject.transform.SetParent(this.parent, false);
            gameObject.transform.SetSiblingIndex(newPlayer.ID + 1);
            PushToTalkPrivateButton componentInChildren = gameObject.GetComponentInChildren <PushToTalkPrivateButton>();

            componentInChildren.SetAudioGroup(newPlayer);
            this.buttons.Add(newPlayer.ID, componentInChildren);
        }