/// <summary> /// Start this instance. /// </summary> void Start() { // morph target needs to be set manually; possibly other components will need the same if (skinnedMeshRenderer == null) { Debug.Log("LipSyncContextMorphTarget.Start WARNING: Please set required public components!"); return; } // make sure there is a phoneme context assigned to this object lipsyncContext = GetComponent <OVRLipSyncContext>(); if (lipsyncContext == null) { Debug.Log("LipSyncContextMorphTarget.Start WARNING: No phoneme context component set to object"); } // Can we record and play sequences? sequencer = GetComponent <OVRLipSyncContextSequencer>(); if (sequencer == null) { Debug.Log("LipSyncContextMorphTarget.Start: No sequencer set. Ability to record and playback keystrokes disabled."); } // Send smoothing amount to context lipsyncContext.SendSignal(OVRLipSync.ovrLipSyncSignals.VisemeSmoothing, SmoothAmount, 0); }
/// <summary> /// Sends the viseme signal. /// </summary> /// <param name="key">Key.</param> /// <param name="viseme">Viseme.</param> /// <param name="arg1">Arg1.</param> void SendVisemeSignal(KeyCode key, int viseme, int arg1) { int result = 0; if (Input.GetKeyDown(key)) { result = lipsyncContext.SendSignal(OVRLipSync.ovrLipSyncSignals.VisemeAmount, KeySendVisemeSignal[viseme], arg1); RecordVisemeSignalSequenceEntry(OVRLipSync.ovrLipSyncSignals.VisemeAmount, KeySendVisemeSignal[viseme], arg1, 0); } if (Input.GetKeyUp(key)) { result = lipsyncContext.SendSignal(OVRLipSync.ovrLipSyncSignals.VisemeAmount, KeySendVisemeSignal[viseme], 0); RecordVisemeSignalSequenceEntry(OVRLipSync.ovrLipSyncSignals.VisemeAmount, KeySendVisemeSignal[viseme], 0, 0); } if (result != OVRLipSync.ovrLipSyncSuccess) { Debug.Log("LipSyncContextMorphTarget.SendVisemeSignal WARNING: Possible bad range on arguments."); } }