Exemple #1
0
        public override void Execute()
        {
            string name = LocalizationManager.Instance.GetString(overrideData ? overrideData :DialogueGraph.textData, key);

            DialogueManager.Instance.canvas.SetName(name);
            DialogueGraph.ExecuteNextNode();
        }
Exemple #2
0
        public void StartDialogue(DialogueGraph dialogue, GameObject[] objectReferences)
        {
            if (CurrentDialogue != null)
            {
                Debug.LogError("Can't start dialogue; a dialogue graph is already being executed.");
                return;
            }

            if (!dialogue.startNode)
            {
                Debug.LogError("Can't start dialogue: no start node was set.");
                return;
            }

            if (dialogue.startNode.graph != dialogue)
            {
                Debug.LogError("Can't start dialogue: start node does not belong to this dialogue graph.");
                return;
            }

            CurrentDialogue  = dialogue;
            ObjectReferences = objectReferences;

            InputManager.onInputReceived += OnInputReceived;

            OnDialogueStarted?.Invoke();

            CurrentDialogue.ExecuteStartNode();
        }
Exemple #3
0
 public override void OnSubmitPressed(InputAction.CallbackContext context)
 {
     if (context.phase == InputActionPhase.Started && context.ReadValueAsButton())
     {
         if (!DialogueManager.Instance.canvas.TrySkipTypewriterAnimation() &&
             !DialogueManager.Instance.canvas.TryAdvanceText())
         {
             DialogueGraph.ExecuteNextNode();
         }
     }
 }
        public override void Execute()
        {
            if (objectIndex >= 0 && objectIndex < DialogueManager.Instance.ObjectReferences.Length)
            {
                DialogueManager.Instance.ObjectReferences[objectIndex].SetActive(active);
            }
            else
            {
                Debug.LogWarningFormat("Object reference index {0} of of range.", objectIndex);
            }

            DialogueGraph.ExecuteNextNode();
        }
        private IEnumerator Wait()
        {
            if (unscaled)
            {
                yield return(new WaitForSecondsRealtime(duration));
            }
            else
            {
                yield return(new WaitForSeconds(duration));
            }

            DialogueGraph.ExecuteNextNode();
        }