Esempio n. 1
0
    private bool typeAProtocol()
    {
        if (protocolStep < 2)
        {
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep <= 2)
        {
            activateActionScreen("Think back to your traumatic experience. (Tap to Continue)");
            child.SendMessage("SetScaredEmotion");
        }
        else if (protocolStep <= 3)
        {
            activateDialogScreen();
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep <= 4)
        {
            child.SendMessage("showZones");
            activateActionScreen("---");

            hugProtocolCoroutine = hugProtocol();
            StartCoroutine(hugProtocolCoroutine);
        }
        else if (protocolStep <= 5)
        {
            if (!hugProtocolComplete)
            {
                return(false);
            }

            StopCoroutine(hugProtocolCoroutine);
            activateDialogScreen();
            dialogScreen.SendMessage("AdvanceText");
            child.SendMessage("SetNeutralEmotion");
        }
        else if (protocolStep <= 6)
        {
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep <= 7)
        {
            phraseDetected = false;
            microphoneManager.StartRecording();
            activateActionScreen("Say these words to your inner-child: 'I will support you'");
            microphoneManager.detectPhrase(phrase1Id, new string[] { "I", "will", "support", "you" });
            phraseProtocolCoroutine = phraseProtocol(phrase1Id);
            StartCoroutine(phraseProtocolCoroutine);
        }
        else if (protocolStep <= 8)
        {
            if (!phraseDetected)
            {
                return(false);
            }
            StopCoroutine(phraseProtocolCoroutine);
            microphoneManager.deletePhrase(phrase1Id);
            microphoneManager.StopRecording();
            phraseDetected = false;

            child.SendMessage("SetHappyEmotion");
            activateActionScreen("Great! now encourage and reassure your inner-child. (Tap to Continue)");
        }
        else if (protocolStep <= 9)
        {
            activateDialogScreen();
            dialogScreen.SendMessage("AdvanceText");
        }

        return(true);
    }
    public void AdvanceProtocol()
    {
        if (!enabled)
        {
            return;
        }

        if (protocolStep < numberFirstSectionDialog - 1)
        {
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep == numberFirstSectionDialog - 1)
        {
            activateActionScreen("Think of your song... sing it to your inner-child. Also slowly dance along to your song");
            microphoneManager.StartRecording();
            songProtocolCoroutine = songProtocol(false);
            StartCoroutine(songProtocolCoroutine);
        }
        else if (protocolStep == numberFirstSectionDialog)
        {
            if (!songDetected)
            {
                return;
            }

            StopCoroutine(songProtocolCoroutine);
            microphoneManager.StopRecording();
            activateDialogScreen();
            dialogScreen.SendMessage("AdvanceText");

            child.SendMessage("SetHappyEmotion");
        }
        else if (protocolStep < numberFirstSectionDialog + 2)
        {
            child.SendMessage("SetNeutralEmotion");
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep == numberFirstSectionDialog + 3)
        {
            activateActionScreen("Please give yourself a self-massage. Feel free to remove the headset if you need to (Tap to continue)");
        }
        else if (protocolStep == numberFirstSectionDialog + 4)
        {
            activateDialogScreen();
            child.SendMessage("SetHappyEmotion");
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep < numberFirstSectionDialog + 6)
        {
            child.SendMessage("SetNeutralEmotion");
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep == numberFirstSectionDialog + 7)
        {
            child.SendMessage("SetSadEmotion");
            activateActionScreen("Recall a distressing memory from your past... (Tap to continue)");
        }
        else if (protocolStep == numberFirstSectionDialog + 8)
        {
            songDetected = false;
            child.SendMessage("SetScaredEmotion");
            activateActionScreen("Now sing the song you associate with happy memories and feelings to make your inner-child feel loved");

            microphoneManager.StartRecording();
            songProtocolCoroutine = songProtocol(true);
            StartCoroutine(songProtocolCoroutine);
        }
        else if (protocolStep == numberFirstSectionDialog + 9)
        {
            if (!songDetected)
            {
                return;
            }

            StopCoroutine(songProtocolCoroutine);
            microphoneManager.StopRecording();
            activateDialogScreen();
            dialogScreen.SendMessage("AdvanceText");

            child.SendMessage("SetHappyEmotion");
        }
        else if (protocolStep <= numberFirstSectionDialog + 11)
        {
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep == numberFirstSectionDialog + 12)
        {
            phraseDetected = false;
            microphoneManager.StartRecording();
            child.SendMessage("SetNeutralEmotion");
            activateActionScreen("Say these words to your inner-child: 'I love you'");
            microphoneManager.detectPhrase(phrase1Id, new string[] { "I", "love", "you" });
            phraseProtocolCoroutine = phraseProtocol(phrase1Id);
            StartCoroutine(phraseProtocolCoroutine);
        }
        else if (protocolStep == numberFirstSectionDialog + 13)
        {
            if (!phraseDetected)
            {
                return;
            }
            StopCoroutine(phraseProtocolCoroutine);
            microphoneManager.deletePhrase(phrase1Id);
            phraseDetected = false;

            child.SendMessage("SetHappyEmotion");
            activateActionScreen("Great! now say these words: 'I vow to protect you'");
            microphoneManager.detectPhrase(phrase2Id, new string[] { "I", "vow", "to", "protect", "you" });
            phraseProtocolCoroutine = phraseProtocol(phrase2Id);
            StartCoroutine(phraseProtocolCoroutine);
        }
        else if (protocolStep == numberFirstSectionDialog + 14)
        {
            if (!phraseDetected)
            {
                return;
            }
            StopCoroutine(phraseProtocolCoroutine);
            microphoneManager.StopRecording();

            activateDialogScreen();
            dialogScreen.SendMessage("AdvanceText");
        }
        else if (protocolStep == numberFirstSectionDialog + 15)
        {
            sceneManager.SendMessage("OpenStartPageScene");
        }

        protocolStep++;
    }