public override Node Create(Vector2 pos)
    {
        DialogMultiOptionsNode node = CreateInstance <DialogMultiOptionsNode>();

        node.rect = new Rect(pos.x, pos.y, 300, 350);
        node.name = "Dailog with Options Node";

        //Previous Node Connections
        node.CreateInput("Previous Node", "DialogForward", NodeSide.Left, 30);
        node.CreateOutput("Back Node", "DialogBack", NodeSide.Left, 50);

        ////Next Node to go to
        //node.CreateOutput("Next Node", "DialogForward", NodeSide.Right, 30);

        node.SayingCharacterName    = "Morgen Freeman";
        node.WhatTheCharacterSays   = "I'm GOD";
        node.SayingBackground       = null;
        node.SayingCharacterPotrait = null;

        node._options = new List <DataHolderForOption>();

        node.AddNewOption();

        return(node);
    }
    public override Node Create(Vector2 pos)
    {
        DialogMultiOptionsNode node = CreateInstance <DialogMultiOptionsNode>();

        //node.rect = new Rect(pos.x, pos.y, 300, 275);
        node.rect.position = pos;
        node.name          = "Dialog with Options Node";

        //Previous Node Connections
        node.CreateInput("Previous Node", "DialogForward", NodeSide.Left, 30);
        node.CreateOutput("Back Node", "DialogBack", NodeSide.Left, 50);

        ////Next Node to go to
        //node.CreateOutput("Next Node", "DialogForward", NodeSide.Right, 30);

        node.CharacterName    = "Character Name";
        node.DialogLine       = "Dialog Line Here";
        node.CharacterPotrait = null;

        node._options = new List <DataHolderForOption>();

        node.AddNewOption();

        return(node);
    }
Ejemplo n.º 3
0
    void LoadChoiceNode(DialogMultiOptionsNode node)
    {
        ChoicePanelHandler choicePanel;

        if (node.CharacterPotrait)
        {
            pictureDialogBox.SetData(node.DialogLine, node.CharacterName, node.CharacterPotrait, true);
            dialogBox.Deactivate();
            choicePanel = pictureDialogBox.choicePanel;
        }
        else
        {
            pictureDialogBox.Deactivate();
            dialogBox.SetData(node.DialogLine, node.CharacterName, true);
            choicePanel = dialogBox.choicePanel;
        }
        List <string> options = node.GetAllOptions();

        for (int i = 0; i < 4; i++)
        {
            if (i < options.Count)
            {
                //disable excess buttons if the options count is below 4
                choicePanel.ChoiceButtons[i].gameObject.SetActive(true);
                choicePanel.ChoiceTexts[i].text = options[i];
            }
            else
            {
                choicePanel.ChoiceButtons[i].gameObject.SetActive(false);
            }
        }
    }
    private void SetAsMultiOptionsNode(DialogMultiOptionsNode dialogNode)
    {
        _backButton.SetActive(dialogNode.IsBackAvailable());
        _okButton.ShowButton(false);

        _characterPortrait.sprite = dialogNode.CharacterPotrait;
        _characterName.text       = dialogNode.CharacterName;
        _sayingText.text          = dialogNode.DialogLine;

        _optionsHolder.CreateOptions(dialogNode.GetAllOptions(), OptionSelected);
        GrowMessageBox(dialogNode.GetAllOptions().Count);
    }
 private void SetAsMultiOptionsNode(DialogMultiOptionsNode dialogNode)
 {
     _okButton.ShowButton(false);
     _optionsHolder.CreateOptions(dialogNode.GetAllOptions(), OptionSelected);
 }