private IEnumerator EaseOut(string key, float from, float to) { var setting = m_BlendShapeMap[key]; float time = 0f; float progress = from; while (time < setting.m_EaseInTime) { time += Time.deltaTime; progress -= Time.deltaTime / setting.m_EaseInTime; m_BlendShape.SetValue(setting.m_Key, progress); yield return(null); } m_BlendShape.SetValue(setting.m_Key, to); VRMLipSyncMorphTarget lipsync = GetComponent <VRMLipSyncMorphTarget>(); if (lipsync != null) { // ローカルプレイヤーはnullなので普通にあり得るケース lipsync.enabled = true; } }
private void SetupLipSync() { VRMBlendShapeProxy vrmBlendShapeProxy = GetComponentInChildren <VRMBlendShapeProxy>(); VRMLipSyncMorphTarget morph_target = vrmBlendShapeProxy.gameObject.AddComponent <VRMLipSyncMorphTarget>(); morph_target.blendShapeProxy = vrmBlendShapeProxy; OVRLipSyncContext lipsync_context = m_PhotonVoice.GetComponent <OVRLipSyncContext>(); morph_target.lipsyncContext = lipsync_context; if (m_PhotonView == null) { Debug.LogWarning("LipSyncSetupper PhotonView is null"); return; } if (m_PhotonView.IsMine == false) { lipsync_context.audioLoopback = true; } }
public void PlayNetwork(object[] data) { int sender_id = (int)data[0]; if (m_PhotonView.ViewID != sender_id) { return; } // タイミング的にAwakeだと間に合わないのでメンドイから毎回取得 VRMLipSyncMorphTarget lipsync = GetComponent <VRMLipSyncMorphTarget>(); if (lipsync != null) { // ローカルプレイヤーはnullなので普通にあり得るケース lipsync.enabled = false; } string key = (string)data[1]; m_CurrentFacial = key; StartCoroutine(EaseIn(key, 0f, 1f)); }