Ejemplo n.º 1
0
    public void CreateContinue(MessageBoxHud caller)
    {
        GameObject button = Instantiate(_continuePrefab);

        button.GetComponent <Button>().onClick.AddListener(caller.OkayPressed);
        _buttons.Add(button);
    }
Ejemplo n.º 2
0
    //Search from the Start Node
    public void ShowDialogWithId(int dialogIdToLoad, bool goBackToBeginning)
    {
        //Nothiing at the beginning
        if (_messageBoxes.ContainsKey(dialogIdToLoad))
        {
            return;
        }

        DialogNodeCanvas nodeCanvas;

        if (_dialogIdTracker.TryGetValue(dialogIdToLoad, out nodeCanvas))            //Checnk if We have already save the Start Node in to the Dictionary.
        {
            nodeCanvas.ActivateDialog(dialogIdToLoad, goBackToBeginning);
        }
        else
        {
            Debug.LogError("Not found Dialog with ID : " + dialogIdToLoad);
        }

        MessageBoxHud messageBox = GameObject.Instantiate(_messageBoxPrefab).GetComponent <MessageBoxHud>();

        messageBox.Construct(dialogIdToLoad, this);
        messageBox.transform.SetParent(_canvasObject, false);
        messageBox.SetData(GetNodeForId(dialogIdToLoad));
        _messageBoxes.Add(dialogIdToLoad, messageBox);
    }
Ejemplo n.º 3
0
    public void ShowDialogWithId(int dialogIdToLoad, bool goBackToBeginning)
    {
        if (_messageBoxes.ContainsKey(dialogIdToLoad))
        {
            return;
        }

        DialogNodeCanvas nodeCanvas;

        if (_dialogIdTracker.TryGetValue(dialogIdToLoad, out nodeCanvas))
        {
            nodeCanvas.ActivateDialog(dialogIdToLoad, goBackToBeginning);
        }
        else
        {
            Debug.LogError("ShowDialogWithId Not found Dialog with ID : " + dialogIdToLoad);
            return;
        }

        MessageBoxHud messageBox = _messageBoxPrefab.GetComponent <MessageBoxHud>();

        messageBox.gameObject.SetActive(true);


        messageBox.Construct(dialogIdToLoad, this);
        messageBox.transform.SetParent(_canvasObject, false);
        messageBox.SetData(GetNodeForId(dialogIdToLoad));
        _messageBoxes.Add(dialogIdToLoad, messageBox);
    }