예제 #1
0
 public void ForceCloseDialog()
 {
     if (_dialog != null)
     {
         Destroy(_dialog.gameObject);
         _dialog = null;
     }
 }
예제 #2
0
 void InitiateDialog()
 {
     if (!player)
     {
         player = GameObject.FindGameObjectWithTag("Player");
     }
     if (!DialBeh)
     {
         DialBeh = GameObject.Find("UIDialog").GetComponent <DialogBehaviour>();
     }
 }
예제 #3
0
    public void ShowConfirm(string title, string message, Action <bool> callback = null)
    {
        GameObject dialog = CreateDialog(confirmPrefab);

        var script = dialog.GetComponent <ConfirmScript>();

        _dialog = script;

        script.Construct(title, message, (yes) => {
            _dialog = null;

            if (callback != null)
            {
                callback(yes);
            }
        });
    }
예제 #4
0
    public void ShowMessage(string message, Sprite sprite, Action callback = null)
    {
        GameObject dialog = CreateDialog(messagePrefab);

        var script = dialog.GetComponent <MessageScript>();

        _dialog = script;

        script.Construct(message, sprite, () => {
            _dialog = null;

            if (callback != null)
            {
                callback();
            }
        });
    }
 /// <summary>
 /// Initialization of dialog controls
 /// </summary>
 private void initializeDialogControls()
 {
     DialogWindow = GameObject.Find("dialog_window");
     if(DialogWindow != null)
     {
         dialogBehaviour = this.DialogWindow.GetComponent<DialogBehaviour>();
         dialogBehaviour.DialogEnds += dialogBehaviour_DialogEnd;
     }
 }