コード例 #1
0
    public void OnPeerJoin(int uid)
    {
        if (ChatManager.Instance.CallID == 0)
        {
            return;
        }

        Debug.Log("OnPeerJoin: uid = " + uid);
        GameObject go = peerImageList.Find((GameObject obj) => { return(obj.name == uid.ToString()); });

        if (go != null)
        {
            return;
        }

        GameObject peer = Instantiate(PeerImagePrefab, ChatPeersContent);
        Toggle     tog  = peer.GetComponent <Toggle>();

        tog.group = ChatPeersContent.GetComponent <ToggleGroup>();

        peer.name = uid.ToString();
        VideoTexure video = peer.transform.Find("RawImage").gameObject.GetComponent <VideoTexure>();

        video.ID = uid;
        peerImageList.Add(peer);

        if (peerImageList.Count == 1)
        {
            SelectedPeerVideo.ID = uid;
            tog.isOn             = true;
        }
    }
コード例 #2
0
    public void OnPeerJoin(int uid)
    {
        if (ChatManager.Instance.CallID == 0)
        {
            return;
        }

        Debug.Log("OnPeerJoin: uid = " + uid);
        GameObject go = peerImageList.Find((GameObject obj) => { return(obj.name == uid.ToString()); });

        if (go != null)
        {
            return;
        }

        GameObject peer = Instantiate(PeerImagePrefab, ChatPeersContent);

        peer.name = uid.ToString();
        VideoTexure video = peer.transform.Find("RawImage").gameObject.AddComponent <VideoTexure>();

        video.ID = uid;
        peerImageList.Add(peer);
    }