public void ExitMission()
 {
     if (currentMission == 1)
     {
         StartCoroutine(sequence.FinishMiniGame1(false));
         GameOverCanvas.SetActive(false);
     }
     else if (currentMission == 3)
     {
         TD_Stats.Lives      = 5;
         TD_Stats.Experience = 10;
         looseCanvas.SetActive(false);
         StartCoroutine(sequence.FinishMiniGame3(false));
     }
 }
示例#2
0
    public void NextNoteDialogueText(string[] dialogues_passed)
    {
        Debug.Log("Photo ID is " + PhotoID.ToString());
        DialogueIMG.sprite = AllSpeakersIMGID[PhotoID];

        current_Dialogue++;

        DialoguesPassedTemp = dialogues_passed;

        //Check if we have ran out of dialogues
        if (current_Dialogue >= dialogues_passed.Length)
        {
            if (CurrentDialoguetextTEXT.text == "I should check on the other cells and get the alarm off")
            {
                //Passed by the WBC Character
                Debug.Log("Enteres here");

                //Switch Camera and Controls
                DialogueBoxUI.gameObject.SetActive(false);
                StartCoroutine(sequencescript.FinishMiniGame1(true));
            }

            PlayerRef.GetComponent <NavMeshPlayerMvt>().enabled = true;
            Singletons.Instance.AudioScript.CharacterAS.volume  = 1f; //To mute running sound

            //Reset everything if the user decides to click on the Button again
            DialogueBoxUI.gameObject.SetActive(false);
            CurrentDialoguetextTEXT.text = " ";
            current_Dialogue             = -1;
            DialoguesPassedTemp          = null;
        }
        else
        {
            //Dialogues haven't finished
            PlayerRef.GetComponent <NavMeshPlayerMvt>().playerAgent.ResetPath(); //Stop Agent midway and clear his calculated path
            PlayerRef.GetComponent <Animator>().SetFloat("speedPercent", 0f);    //To stop the running animation
            Singletons.Instance.AudioScript.CharacterAS.volume  = 0f;            //To mute running sound
            PlayerRef.GetComponent <NavMeshPlayerMvt>().enabled = false;
            Num_of_Dialogues = dialogues_passed.Length;
            DialogueBoxUI.gameObject.SetActive(true); //For the start level
            CurrentDialoguetextTEXT.text = dialogues_passed[current_Dialogue];
        }
    }