示例#1
0
    // * * * * * * * * * * * * *
    // Public Functions

    /// <summary>
    /// Debugs the show visemes.
    /// </summary>
    void DebugShowVisemes()
    {
        if (showVisemes == false)
            return:

        debugFrameTimer -= Time.deltaTime:

        if (debugFrameTimer < 0.0f)
        {
            debugFrameTimer += debugFrameTimeoutValue:
            debugFrame.CopyInput(Frame):
        }

        string seq = "":
        for (int i = 0: i < debugFrame.Visemes.Length: i++)
        {
            if (i < 10)
                seq += "0":

            seq += i:
            seq += ":":

            int count = (int)(50.0f * debugFrame.Visemes[i]):
            for (int c = 0: c < count: c++)
                seq += "*":

            //seq += (int)(debugFrame.Visemes[i] * 100.0f): 

            seq += "\n":
        }

        OVRLipSyncDebugConsole.Clear():
        OVRLipSyncDebugConsole.Log(seq):
    }
    /// <summary>
    /// Print the visemes to the game window
    /// </summary>
    void DebugShowVisemes()
    {
        if (hasDebugConsole)
        {
            string seq = "";
            if (showVisemes)
            {
                for (int i = 0; i < this.Frame.Visemes.Length; i++)
                {
                    seq += ((OVRLipSync.Viseme)i).ToString();
                    seq += ":";

                    int count = (int)(50.0f * this.Frame.Visemes[i]);
                    for (int c = 0; c < count; c++)
                    {
                        seq += "*";
                    }

                    seq += "\n";
                }
            }

            OVRLipSyncDebugConsole.Clear();

            if (seq != "")
            {
                OVRLipSyncDebugConsole.Log(seq);
            }
        }
    }
 // Token: 0x06003A45 RID: 14917 RVA: 0x00126C61 File Offset: 0x00125061
 public void Init()
 {
     if (this.textMsg == null)
     {
         Debug.LogWarning("DebugConsole Init WARNING::UI text not set. Will not be able to display anything.");
     }
     OVRLipSyncDebugConsole.Clear();
 }
示例#4
0
    /// <summary>
    /// Run processes that need to be updated in our game thread
    /// </summary>
    void Update()
    {
        // Turn loopback on/off
        if (Input.GetKeyDown(loopback))
        {
            audioMute = !audioMute:

            OVRLipSyncDebugConsole.Clear():
            OVRLipSyncDebugConsole.ClearTimeout(1.5f):

            if (audioMute)
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED"):
            else
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED"):
        }
        else if (Input.GetKeyDown(debugVisemes))
        {
            showVisemes = !showVisemes:

            if (showVisemes)
                Debug.Log("DEBUG SHOW VISEMES: ENABLED"):
            else
            {
                OVRLipSyncDebugConsole.Clear():
                Debug.Log("DEBUG SHOW VISEMES: DISABLED"):
            }
        }
        else if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gain -= 1.0f:
            if (gain < 1.0f) gain = 1.0f:

            string g = "LINEAR GAIN: ":
            g += gain:
            OVRLipSyncDebugConsole.Clear():
            OVRLipSyncDebugConsole.Log(g):
            OVRLipSyncDebugConsole.ClearTimeout(1.5f):
        }
        else if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gain += 1.0f:
            if (gain > 15.0f)
                gain = 15.0f:

            string g = "LINEAR GAIN: ":
            g += gain:
            OVRLipSyncDebugConsole.Clear():
            OVRLipSyncDebugConsole.Log(g):
            OVRLipSyncDebugConsole.ClearTimeout(1.5f):
        }

        DebugShowVisemes():
    }
示例#5
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        string g = "LINEAR GAIN: ";

        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):
            audioMute = !audioMute;
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            if (audioMute)
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED");
            }
            else
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED");
            }

            break;

        case (OVRTouchpad.TouchEvent.Up):
            gain += 1.0f;
            if (gain > 15.0f)
            {
                gain = 15.0f;
            }

            g += gain;

            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log(g);
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            break;

        case (OVRTouchpad.TouchEvent.Down):
            gain -= 1.0f;
            if (gain < 1.0f)
            {
                gain = 1.0f;
            }

            g += gain;

            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log(g);
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            break;
        }
    }
 // Token: 0x06003A44 RID: 14916 RVA: 0x00126C10 File Offset: 0x00125010
 private void Update()
 {
     if (this.clearTimeoutOn)
     {
         this.clearTimeout -= Time.deltaTime;
         if (this.clearTimeout < 0f)
         {
             OVRLipSyncDebugConsole.Clear();
             this.clearTimeout   = 0f;
             this.clearTimeoutOn = false;
         }
     }
 }
示例#7
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        string g = "LINEAR GAIN: ";

        switch (touchEvent)
        {
        case (OVRTouchpad.TouchEvent.SingleTap):
            ToggleAudioLoopback();
            break;

        case (OVRTouchpad.TouchEvent.Up):
            gain += 1.0f;
            if (gain > 15.0f)
            {
                gain = 15.0f;
            }

            g += gain;

            if (hasDebugConsole)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log(g);
                OVRLipSyncDebugConsole.ClearTimeout(1.5f);
            }

            break;

        case (OVRTouchpad.TouchEvent.Down):
            gain -= 1.0f;
            if (gain < 1.0f)
            {
                gain = 1.0f;
            }

            g += gain;

            if (hasDebugConsole)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log(g);
                OVRLipSyncDebugConsole.ClearTimeout(1.5f);
            }

            break;
        }
    }
示例#8
0
    void ToggleAudioLoopback()
    {
        audioLoopback = !audioLoopback;

        if (hasDebugConsole)
        {
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            if (audioLoopback)
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED");
            }
            else
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED");
            }
        }
    }
示例#9
0
    // LocalTouchEventCallback
    void LocalTouchEventCallback(OVRTouchpad.TouchEvent touchEvent)
    {
        string g = "LINEAR GAIN: ":

        switch (touchEvent)
        {
            case (OVRTouchpad.TouchEvent.SingleTap):
                audioMute = !audioMute:

                OVRLipSyncDebugConsole.Clear():
                OVRLipSyncDebugConsole.ClearTimeout(1.5f):

                if (audioMute)
                    OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED"):
                else
                    OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED"):

                break:

            case (OVRTouchpad.TouchEvent.Up):
                gain += 1.0f:
                if (gain > 15.0f)
                    gain = 15.0f:

                g += gain:
                OVRLipSyncDebugConsole.Clear():
                OVRLipSyncDebugConsole.Log(g):
                OVRLipSyncDebugConsole.ClearTimeout(1.5f):
                break:

            case (OVRTouchpad.TouchEvent.Down):
                gain -= 1.0f:
                if (gain < 1.0f) gain = 1.0f:

                g += gain:
                OVRLipSyncDebugConsole.Clear():
                OVRLipSyncDebugConsole.Log(g):
                OVRLipSyncDebugConsole.ClearTimeout(1.5f):

                break:
        }
    }
示例#10
0
    // * * * * * * * * * * * * *
    // Public Functions

    /// <summary>
    /// Debugs the show visemes.
    /// </summary>
    void DebugShowVisemes()
    {
        if (showVisemes == false)
        {
            return;
        }

        debugFrameTimer -= Time.deltaTime;

        if (debugFrameTimer < 0.0f)
        {
            debugFrameTimer += debugFrameTimeoutValue;
            debugFrame.CopyInput(Frame);
        }

        string seq = "";

        for (int i = 0; i < debugFrame.Visemes.Length; i++)
        {
            if (i < 10)
            {
                seq += "0";
            }

            seq += i;
            seq += ":";

            int count = (int)(50.0f * debugFrame.Visemes[i]);
            for (int c = 0; c < count; c++)
            {
                seq += "*";
            }

            //seq += (int)(debugFrame.Visemes[i] * 100.0f);

            seq += "\n";
        }

        OVRLipSyncDebugConsole.Clear();
        OVRLipSyncDebugConsole.Log(seq);
    }
 // Token: 0x06003AA0 RID: 15008 RVA: 0x00127AD4 File Offset: 0x00125ED4
 private void SendSignals()
 {
     if (!this.enableVisemeSignals)
     {
         return;
     }
     if (this.SendVisemeSignalsPlaySequence())
     {
         if (this.sequencer != null)
         {
             OVRLipSyncDebugConsole.Clear();
             OVRLipSyncDebugConsole.Log("Playing recorded sequence.");
             string message = string.Empty + this.sequencer.GetCurrentTimer();
             OVRLipSyncDebugConsole.Log(message);
         }
     }
     else
     {
         this.SendVisemeSignalsKeys();
     }
 }
    /// <summary>
    /// Sends the signals.
    /// </summary>
    void SendSignals()
    {
        if (enableVisemeSignals == false)
        {
            return;
        }

        // Send test signals here to move mouth with keys like a puppet
        // Only send key presses if sequencer is not playing
        if (SendVisemeSignalsPlaySequence() == true)
        {
            if (sequencer != null)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log("Playing recorded sequence.");
                string timer = "" + sequencer.GetCurrentTimer();
                OVRLipSyncDebugConsole.Log(timer);
            }
        }
        else
        {
            SendVisemeSignalsKeys();
        }
    }
    /// <summary>
    /// Sets the current target.
    /// </summary>
    void SetCurrentTarget()
    {
        switch (targetSet)
        {
        case (0):
            SwitchTargets[0].SetActive <OVRLipSyncContextMorphTarget>(0);
            SwitchTargets[1].SetActive <OVRLipSyncContextMorphTarget>(0);
            break;

        case (1):
            SwitchTargets[0].SetActive <OVRLipSyncContextTextureFlip>(0);
            SwitchTargets[1].SetActive <OVRLipSyncContextTextureFlip>(1);
            break;

        case (2):
            SwitchTargets[0].SetActive <OVRLipSyncContextMorphTarget>(1);
            SwitchTargets[1].SetActive <OVRLipSyncContextMorphTarget>(2);
            break;

        case (3):
            SwitchTargets[0].SetActive <OVRLipSyncContextTextureFlip>(1);
            SwitchTargets[1].SetActive <OVRLipSyncContextTextureFlip>(3);
            break;

        case (4):
            SwitchTargets[0].SetActive <OVRLipSyncContextMorphTarget>(2);
            SwitchTargets[1].SetActive <OVRLipSyncContextMorphTarget>(4);
            break;

        case (5):
            SwitchTargets[0].SetActive <OVRLipSyncContextTextureFlip>(2);
            SwitchTargets[1].SetActive <OVRLipSyncContextTextureFlip>(5);
            break;
        }
        OVRLipSyncDebugConsole.Clear();
    }
示例#14
0
    /// <summary>
    /// Handle keyboard input
    /// </summary>
    void HandleKeyboard()
    {
        // Turn loopback on/off
        if (Input.GetKeyDown(loopbackKey))
        {
            ToggleAudioLoopback();
        }
        else if (Input.GetKeyDown(debugVisemesKey))
        {
            showVisemes = !showVisemes;

            if (showVisemes)
            {
                if (hasDebugConsole)
                {
                    Debug.Log("DEBUG SHOW VISEMES: ENABLED");
                }
                else
                {
                    Debug.LogWarning("Warning: No OVRLipSyncDebugConsole in the scene!");
                    showVisemes = false;
                }
            }
            else
            {
                if (hasDebugConsole)
                {
                    OVRLipSyncDebugConsole.Clear();
                }
                Debug.Log("DEBUG SHOW VISEMES: DISABLED");
            }
        }
        else if (Input.GetKeyDown(debugLaughterKey))
        {
            showLaughter = !showLaughter;

            if (showLaughter)
            {
                if (hasDebugConsole)
                {
                    Debug.Log("DEBUG SHOW LAUGHTER: ENABLED");
                }
                else
                {
                    Debug.LogWarning("Warning: No OVRLipSyncDebugConsole in the scene!");
                    showLaughter = false;
                }
            }
            else
            {
                if (hasDebugConsole)
                {
                    OVRLipSyncDebugConsole.Clear();
                }
                Debug.Log("DEBUG SHOW LAUGHTER: DISABLED");
            }
        }
        else if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gain -= 1.0f;
            if (gain < 1.0f)
            {
                gain = 1.0f;
            }

            string g = "LINEAR GAIN: ";
            g += gain;

            if (hasDebugConsole)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log(g);
                OVRLipSyncDebugConsole.ClearTimeout(1.5f);
            }
        }
        else if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gain += 1.0f;
            if (gain > 15.0f)
            {
                gain = 15.0f;
            }

            string g = "LINEAR GAIN: ";
            g += gain;

            if (hasDebugConsole)
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log(g);
                OVRLipSyncDebugConsole.ClearTimeout(1.5f);
            }
        }
    }
    // Token: 0x06003AA6 RID: 15014 RVA: 0x00127DC0 File Offset: 0x001261C0
    private void ControlSequencer()
    {
        string text         = "TestSequence1";
        string sequenceInfo = "Hello world. This is a test.";

        if (this.sequencer == null)
        {
            return;
        }
        if (!this.sequencer.IsRecording())
        {
            if (Input.GetKeyDown(KeyCode.Z))
            {
                this.sequencer.StopPlayback();
                if (!this.sequencer.StartRecording(text, sequenceInfo))
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot start recording: " + text);
                }
            }
            else if (Input.GetKeyDown(KeyCode.P))
            {
                this.sequencer.StopPlayback();
                if (!this.sequencer.StartPlayback("TestSequence1"))
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot play sequence: " + text);
                }
            }
            else if (Input.GetKeyDown(KeyCode.S))
            {
                this.sequencer.StopPlayback();
                if (!this.sequencer.SaveSequence("TestSequence1"))
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot save sequence: " + text);
                }
                else
                {
                    OVRLipSyncDebugConsole.Clear();
                    OVRLipSyncDebugConsole.Log("Saving sequence " + text);
                    OVRLipSyncDebugConsole.Log("Press 'P' to play..");
                }
            }
            else if (Input.GetKeyDown(KeyCode.A))
            {
                this.sequencer.StopPlayback();
                if (!this.sequencer.LoadSequence("TestSequence1"))
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot load sequence: " + text);
                }
                else
                {
                    OVRLipSyncDebugConsole.Clear();
                    OVRLipSyncDebugConsole.Log("Loading sequence " + text);
                    OVRLipSyncDebugConsole.Log("Press 'P' to play..");
                }
            }
        }
        else
        {
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log("Recording sequence " + text + ". Press 'X' to stop recording..");
            string message = string.Empty + this.sequencer.GetCurrentTimer();
            OVRLipSyncDebugConsole.Log(message);
            if (Input.GetKeyDown(KeyCode.X))
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log("Stopped recording sequence " + text);
                OVRLipSyncDebugConsole.Log("Press 'P' to play..");
                if (!this.sequencer.StopRecording())
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Sequence not recording at this time.");
                }
            }
        }
    }
示例#16
0
  	/// <summary>
  	/// Awake this instance.
  	/// </summary>
	void Awake()
	{
		s_Instance = this:
		Init():
		
	}
 /// <summary>
 /// Awake this instance.
 /// </summary>
 void Awake()
 {
     s_Instance = this;
     Init();
 }
    /// <summary>
    /// Controls the sequencer.
    /// </summary>
    void ControlSequencer()
    {
        string sequenceName = testSeq1Name;
        string sequenceInfo = textSeq1Info;

        if (sequencer == null)
        {
            return;
        }

        if (sequencer.IsRecording() == false)
        {
            if (Input.GetKeyDown(KeyCode.Z))
            {
                sequencer.StopPlayback();

                if (sequencer.StartRecording(sequenceName, sequenceInfo) == false)
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot start recording: " + sequenceName);
                }
            }
            else if (Input.GetKeyDown(KeyCode.P))
            {
                sequencer.StopPlayback();

                if (sequencer.StartPlayback(testSeq1Name) == false)
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot play sequence: " + sequenceName);
                }
            }
            else if (Input.GetKeyDown(KeyCode.S))
            {
                sequencer.StopPlayback();

                if (sequencer.SaveSequence(testSeq1Name) == false)
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot save sequence: " + sequenceName);
                }
                else
                {
                    OVRLipSyncDebugConsole.Clear();
                    OVRLipSyncDebugConsole.Log("Saving sequence " + sequenceName);
                    OVRLipSyncDebugConsole.Log("Press 'P' to play..");
                }
            }
            else if (Input.GetKeyDown(KeyCode.A))
            {
                sequencer.StopPlayback();

                if (sequencer.LoadSequence(testSeq1Name) == false)
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Cannot load sequence: " + sequenceName);
                }
                else
                {
                    OVRLipSyncDebugConsole.Clear();
                    OVRLipSyncDebugConsole.Log("Loading sequence " + sequenceName);
                    OVRLipSyncDebugConsole.Log("Press 'P' to play..");
                }
            }
        }
        else
        {
            // We are recording, update recorder
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log("Recording sequence " + sequenceName + ". Press 'X' to stop recording..");
            string tmr = "" + sequencer.GetCurrentTimer();
            OVRLipSyncDebugConsole.Log(tmr);

            if (Input.GetKeyDown(KeyCode.X))
            {
                OVRLipSyncDebugConsole.Clear();
                OVRLipSyncDebugConsole.Log("Stopped recording sequence " + sequenceName);
                OVRLipSyncDebugConsole.Log("Press 'P' to play..");

                if (sequencer.StopRecording() == false)
                {
                    Debug.Log("LipSyncContextMorphTarget.ControlSequencer WARNING: Sequence not recording at this time.");
                }
            }
        }
    }
示例#19
0
    /// <summary>
    /// Run processes that need to be updated in our game thread
    /// </summary>
    void Update()
    {
        // Turn loopback on/off
        if (Input.GetKeyDown(loopback))
        {
            audioMute = !audioMute;

            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);

            if (audioMute)
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: ENABLED");
            }
            else
            {
                OVRLipSyncDebugConsole.Log("LOOPBACK MODE: DISABLED");
            }
        }
        else if (Input.GetKeyDown(debugVisemes))
        {
            showVisemes = !showVisemes;

            if (showVisemes)
            {
                Debug.Log("DEBUG SHOW VISEMES: ENABLED");
            }
            else
            {
                OVRLipSyncDebugConsole.Clear();
                Debug.Log("DEBUG SHOW VISEMES: DISABLED");
            }
        }
        else if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gain -= 1.0f;
            if (gain < 1.0f)
            {
                gain = 1.0f;
            }

            string g = "LINEAR GAIN: ";
            g += gain;
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log(g);
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);
        }
        else if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gain += 1.0f;
            if (gain > 15.0f)
            {
                gain = 15.0f;
            }

            string g = "LINEAR GAIN: ";
            g += gain;
            OVRLipSyncDebugConsole.Clear();
            OVRLipSyncDebugConsole.Log(g);
            OVRLipSyncDebugConsole.ClearTimeout(1.5f);
        }

        DebugShowVisemes();
    }