Exemple #1
0
    public static void AddRemoteUser(ulong userID)
    {
        RemotePlayer remoteUser = new RemotePlayer();

        remoteUser.RemoteAvatar = Instantiate(s_instance.remoteAvatarPrefab);
        remoteUser.RemoteAvatar.oculusUserID    = userID.ToString();
        remoteUser.RemoteAvatar.ShowThirdPerson = true;
        remoteUser.p2pConnectionState           = PeerConnectionState.Unknown;
        remoteUser.voipConnectionState          = PeerConnectionState.Unknown;
        remoteUser.stillInRoom  = true;
        remoteUser.remoteUserID = userID;

        s_instance.AddUser(userID, ref remoteUser);
        s_instance.p2pManager.ConnectTo(userID);
        s_instance.voipManager.ConnectTo(userID);

        var audioSource = remoteUser.RemoteAvatar.gameObject.AddComponent <VoipAudioSourceHiLevel>();

        audioSource.senderID = userID;

        s_instance.LogOutputLine("Adding User " + userID);
    }