Пример #1
0
    // Se tem 1 prompt ele ignora o prompt e mostra o diálogo
    public void SelectPrompt(List <DialoguePrompt> _dialoguePrompts, EndOfDialogue endAction, string HeaderPrompt)
    {
        nameText.transform.parent.gameObject.SetActive(false);

        dialogueOptions.transform.parent.gameObject.SetActive(true);
        dialogueOptions.SetActive(true);

        dialoguePrompts = _dialoguePrompts;
        EndDialogue     = endAction;

        maxDialogueOptions = dialoguePrompts.Count - 1;
        int index = 0;

        foreach (Transform dialogueChild in dialogueOptions.GetComponentInChildren <Transform>(true))
        {
            if (index <= maxDialogueOptions)
            {
                dialogueChild.GetChild(0).GetComponent <Text>().text = dialoguePrompts[index].DialogPrompt;
                dialogueChild.gameObject.SetActiveRecursively(true);

                index++;
            }
        }

        dialogueOptions.transform.GetChild(0).GetChild(0).GetComponentInChildren <Text>().fontStyle = FontStyle.Bold;
        currentSelectedPrompt = 0;

        dialogueOptions.transform.parent.parent.gameObject.SetActive(true);
        dialogueOptions.SetActive(true);

        DialogueSelection = true;

        StartCoroutine(DelayBetweenSentences());
        canDisplayNextSentence = false;
    }
Пример #2
0
    // ------------------------- Functions ------------------------- //

    // --- Public Functions --- //

    /// < DoAction(): void >
    /// Show a dialogue that it's selected on Prompt.
    ///  Function changes the value from Cursor so it can move freely in the screen to choose the dialog Prompt.
    ///  Wait if a dialogue it's over so it won't show a new dialogue right after.
    ///  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - rever isso
    /// </ DoAction(): void >
    public override void DoAction()
    {
        base.DoAction();

        MouseController.currentMouseState = MouseState.OnPrompt;

        function = EndAction;

        if (canStartDialogAgain)
        {
            DialogueManager.Instance.SelectPrompt(DialoguePrompts, function, PromptHeader);
            startDialogue       = true;
            canStartDialogAgain = false;
        }
        else
        {
            base.EndAction();
        }
    }
Пример #3
0
    // --- Public Functions --- //

    public override void DoAction()
    {
        base.DoAction();
        if (audio)
        {
            audio.Play();
        }
        function = EndDialogue;

        if (canStartDialogAgain)
        {
            DialogueManager.Instance.SelectPrompt(DialoguePrompts, function, PromptHeader);
            startDialogue       = true;
            canStartDialogAgain = false;
        }
        else
        {
            base.EndAction();
        }
    }
Пример #4
0
    // --- Public Functions --- //

    public override void DoAction()
    {
        base.DoAction();

        function = EndDialogue;

        if (canStartDialogAgain && ObjectoCondicional.GetComponent <ActionUnlock>().Unlocked)
        {
            if (audio)
            {
                audio.Play();
            }
            DialogueManager.Instance.SelectPrompt(DialoguePrompts, function, PromptHeader);
            startDialogue       = true;
            canStartDialogAgain = false;
        }
        else
        {
            base.EndAction();
        }
    }