public virtual void Update() { // Look for updates from remote users p2pManager.GetRemotePackets(); // update avatar mouths to match voip volume foreach (KeyValuePair <ulong, RemotePlayer> kvp in remoteUsers) { if (kvp.Value.voipSource == null) { if (kvp.Value.RemoteAvatar.MouthAnchor != null) { kvp.Value.voipSource = kvp.Value.RemoteAvatar.MouthAnchor.AddComponent <VoipAudioSourceHiLevel>(); kvp.Value.voipSource.senderID = kvp.Value.remoteUserID; } } if (kvp.Value.voipSource != null) { float remoteVoiceCurrent = Mathf.Clamp(kvp.Value.voipSource.peakAmplitude * VOIP_SCALE, 0f, 1f); kvp.Value.RemoteAvatar.VoiceAmplitude = remoteVoiceCurrent; } } if (localAvatar != null) { localAvatar.VoiceAmplitude = Mathf.Clamp(voiceCurrent * VOIP_SCALE, 0f, 1f); } Oculus.Platform.Request.RunCallbacks(); }
public virtual void Update() { // Look for updates from remote users p2pManager.GetRemotePackets(); // update avatar mouths to match voip volume foreach (KeyValuePair <ulong, RemotePlayer> kvp in remoteUsers) { float remoteVoiceCurrent = Mathf.Clamp(kvp.Value.voipSource.peakAmplitude * VOIP_SCALE, 0f, 1f); kvp.Value.RemoteAvatar.VoiceAmplitude = remoteVoiceCurrent; } if (localAvatar != null) { localAvatar.VoiceAmplitude = Mathf.Clamp(voiceCurrent * VOIP_SCALE, 0f, 1f); } }
public virtual void Update() { // Look for updates from remote users p2pManager.GetRemotePackets(); }