Пример #1
0
 public static void Update()
 {
     if (dialogState == DialogueStates.Talking)
     {
         if (currentChar < TextLength)
         {
             displayText += NextChar;
         }
         else
         {
             dialogState = DialogueStates.Pause;
         }
     }
     else if (InputMapper.STRICTACTION)
     {
         displayText     = "";
         currentChar     = 0;
         currentDialogue = dialog[currentDialogue].NextDialog;
         if (currentDialogue == "STOPDIALOG")
         {
             EngineStates.DialogState = DialogueStates.Inactive;
         }
         else
         {
             dialogState = DialogueStates.Talking;
         }
     }
 }
    public IEnumerator StartDialogueSaving(string location)
    {
        GameControl.control.Freeze();
        currentState = DialogueStates.SavingDialogue;
        GameControl.control.saveRoomName = location;
        savingPanel.GetComponentInChildren <Text>().text = "Saving...";
        yield return(StartCoroutine(GameControl.control.Save()));

        yield return(new WaitForSeconds(0.2f));

        savingPanel.GetComponentInChildren <Text>().text = "Saved!";

        GameControl.control.LoadTemp();
        characterNameText.text = GameControl.control.playerName;
        System.TimeSpan ts = System.TimeSpan.FromSeconds((int)GameControl.control.playedTimeTemp);
        playTimeText.text = ts.ToString();
        locationText.text = GameControl.control.saveRoomNameTemp;

        for (int i = 0; i < 7; i++)
        {
            saveLens.transform.GetChild(i).gameObject.SetActive(GameControl.control.lensTemp[i]);
            saveMasks.transform.GetChild(i).gameObject.SetActive(GameControl.control.masksTemp[i]);
        }

        YesButton.Select();
        YesButton.OnSelect(null);
        yield return(new WaitForEndOfFrame());

        yield return(WaitForKeyDown("Submit"));

        GameControl.control.Unfreeze();
        currentState = DialogueStates.NoDialogue;
    }
    public IEnumerator StartDialogueChoice(string dialogue, string leftString, string rightString)
    {
        currentState = DialogueStates.ChoiceDialogue;
        GameControl.control.Freeze();
        yield return(new WaitForEndOfFrame());

        yield return(StartCoroutine(AnimateText(dialogue, choiceText)));

        yield return(new WaitForSeconds(0.2f));

        yield return(StartCoroutine(AnimateText(leftString, leftText)));

        yield return(new WaitForSeconds(0.2f));

        yield return(StartCoroutine(AnimateText(rightString, rightText)));

        yield return(new WaitForSeconds(0.2f));

        LeftButton.Select();
        yield return(StartCoroutine(WaitForKeyDown("Submit")));

        yield return(new WaitForEndOfFrame());

        editText.text       = "";
        editSpriteText.text = "";
        choiceText.text     = "";
        rightText.text      = "";
        leftText.text       = "";
        GameControl.control.Unfreeze();
    }
    public IEnumerator StartDialogueSprite(string[] dialogue, string newFont, int character, int emotion)
    {
        //The player is frozen in place to prevent them from moving around while dialogue is occuring
        GameControl.control.Freeze();
        //The dialogue window is made visible
        currentState = DialogueStates.SpriteDialogue;
        SpriteChange(character, emotion);
        yield return(new WaitForEndOfFrame());

        yield return(new WaitForEndOfFrame());

        FontChange(newFont);

        //Begin iterating over the dialogue lines
        foreach (string text in dialogue)
        {
            //Start the dialogue function for a specific line of dialogue and pause this function until it returns
            //When it returns, continue the loop
            yield return(StartCoroutine(Dialogue(text, editSpriteText)));
        }
        //Make the dialogue window transparent again
        currentState = DialogueStates.NoDialogue;
        //Return control to the player
        GameControl.control.Unfreeze();
    }
Пример #5
0
 public static void PlayDialog(Dictionary <string, DialogScript> dialogue, string startDialog)
 {
     currentChar              = 0;
     dialog                   = dialogue;
     currentDialogue          = startDialog;
     EngineStates.DialogState = DialogueStates.Active;
     dialogState              = DialogueStates.Talking;
 }
 public IEnumerator StartDialogueSolo(string[] dialogue)
 {
     //The player is frozen in place to prevent them from moving around while dialogue is occuring
     GameControl.control.Freeze();
     //The dialogue window is made visible
     currentState = DialogueStates.SoloDialogue;
     FontChange("default");
     //Begin iterating over the dialogue lines
     foreach (string text in dialogue)
     {
         //Start the dialogue function for a specific line of dialogue and pause this function until it returns
         //When it returns, continue the loop
         yield return(StartCoroutine(Dialogue(text, editText)));
     }
     //Make the dialogue window transparent again
     currentState = DialogueStates.NoDialogue;
     //Return control to the player
     GameControl.control.Unfreeze();
 }
 public void OnNoPress()
 {
     currentState = DialogueStates.NoDialogue;
     GameControl.control.saved = false;
     //GameControl.control.Unfreeze();
 }
 public void OnYesPress()
 {
     GameControl.control.saved = true;
     currentState = DialogueStates.NoDialogue;
     //GameControl.control.Unfreeze();
 }