// Run an internal command. public override IEnumerator RunCommand(Yarn.Command command) { // "Perform" the command Debug.Log("Command: " + command.text); yield break; }
/// Run a command. public override Dialogue.HandlerExecutionType RunCommand(Yarn.Command command, System.Action onComplete) { // Dispatch this command via the 'On Command' handler. onCommand?.Invoke(command.Text); // Signal to the DialogueRunner that it should continue executing. return(Dialogue.HandlerExecutionType.ContinueExecution); }
/// Run an internal command. public override IEnumerator RunCommand(Yarn.Command command) { // "Perform" the command Debug.Log("Command: " + command.text); if (command.text == "start fishing game") { SceneManager.LoadScene("Mini Games/Start Fishing"); } else if (command.text == "go to town") { SceneManager.LoadScene("Locations/" + GameManager.Instance.LastScene); } else if (command.text == "go to house") { SceneManager.LoadScene("Locations/Skylar House"); } else if (command.text == "go to cave") { SceneManager.LoadScene("Mini Games/Bat Attack"); } else if (command.text == "go to box") { SceneManager.LoadScene("Mini Games/Wooden Box"); } else if (command.text == "go to letter") { BoxCollider[] disable = GameObject.FindObjectsOfType <BoxCollider> (); for (int i = 0; i < disable.Length; i++) { disable [i].enabled = false; } Letter.SetActive(true); } else if (command.text == "disable wheel") { GameObject.Find("Wheel").SetActive(false); } else if (command.text == "skylar in house") { obj1.SetActive(false); obj2.SetActive(true); } else if (command.text == "book unclickable") { obj1.SetActive(false); obj2.SetActive(false); obj3.SetActive(true); } else if (command.text == "book clickable") { obj1.SetActive(true); } else if (command.text == "go to wall") { SceneManager.LoadScene("Locations/Wall"); } yield break; }
/// Runs a command. /// <inheritdoc/> public override Dialogue.HandlerExecutionType RunCommand(Yarn.Command command, System.Action onCommandComplete) { // Dispatch this command via the 'On Command' handler. onCommand?.Invoke(command.Text); // Signal to the DialogueRunner that it should continue // executing. (This implementation of RunCommand always signals // that execution should continue, and never calls // onCommandComplete.) return(Dialogue.HandlerExecutionType.ContinueExecution); }
/// Run an internal command. public override IEnumerator RunCommand(Yarn.Command command) { // "Perform" the command string[] commandArray = command.text.Split(' '); if (commandArray[0] == "wait") { float time = float.Parse(commandArray[1]); yield return(new WaitForSeconds(time)); } yield break; }
/// Called by buttons to make a selection. //public void SetOption (int selectedOption) //{ // // Call the delegate to tell the dialogue system that we've // // selected an option. // SetSelectedOption (selectedOption); // // Now remove the delegate so that the loop in RunOptions will exit // SetSelectedOption = null; //} /// Run an internal command. public override IEnumerator RunCommand(Yarn.Command command) { Debug.Log("Command: " + command.text); // Check for non-parameterized command strings switch (command.text.ToLower()) { case "wait scene": while (!sceneLoader.IsSceneUnloaded()) { yield return(new WaitForSeconds(0.1f)); } yield break; } // Check for parameterized command strings var words = command.text.Split(' '); var commandText = words[0].ToLower(); switch (commandText) { case "wait": float fWait; try { fWait = float.Parse(words[1]); } catch (System.FormatException) { Debug.LogErrorFormat("wait <num> must contain an integer ({0})", command.text); break; } yield return(new WaitForSeconds(fWait)); yield break; case "show": ShowCanvas(); yield break; case "hide": HideCanvas(); yield break; default: Debug.LogError(Utils.Join("Unrecognized command:", commandText)); yield break; } yield break; }
/// Run an internal command. public override IEnumerator RunCommand(Yarn.Command command) { // "Perform" the command Debug.Log("Command: " + command.text); if (command.text.Equals("waitTillEmpty")) { while (!dispenserInventory.empty) { yield return(null); } } yield break; }
IEnumerator RunCommand(Yarn.Command command) { optionStrings = new string[0]; displayString = "(Yarn command: <<" + command.text + ">>)"; showContinuePrompt = true; useConsolasFont = true; // Wait for user input inputContinue = false; yield return(new WaitUntil((() => inputContinue == false && MerinoPrefs.useAutoAdvance == false))); showContinuePrompt = false; useConsolasFont = false; }
public IEnumerator RunCommand (Yarn.Command command, bool autoAdvance) { optionStrings = new string[0]; displayString = "(Yarn command: <<" + command.text + ">>)"; inputContinue = false; useConsolasFont = true; showContinuePrompt = true; while (inputContinue == false && autoAdvance == false) { yield return new WaitForSeconds(0.01f); } showContinuePrompt = false; useConsolasFont = false; }
// Run an internal command. public override IEnumerator RunCommand(Yarn.Command command) { // "Perform" the command Debug.Log("Command: " + command.text); // Example: forward commands that begin with "set-sprite" to a SpriteSwitcher var commandElements = command.text.Split(' '); if (commandElements.Length > 0) { // Syntax for this command = setsprite NAME SPRITENAME // GameObject NAME must have a SpriteSwitcher component // The SpriteSwitcher must have a sprite named SPRITENAME if (commandElements[0] == "setsprite") { var switcher = GameObject.Find(commandElements[1]) .GetComponent <SpriteSwitcher>(); var spriteName = commandElements[2]; switcher.UseSprite(spriteName); } } yield break; }
/// Perform some game-specific command. public abstract IEnumerator RunCommand(Yarn.Command command);
/// Perform some game-specific command. public abstract Dialogue.HandlerExecutionType RunCommand(Yarn.Command command, System.Action onCommandComplete);
/// Run an internal command. public override Dialogue.HandlerExecutionType RunCommand(Yarn.Command command, System.Action onComplete) { StartCoroutine(DoRunCommand(command, onComplete)); return(Dialogue.HandlerExecutionType.ContinueExecution); }
/// <summary> /// Run an internal command /// </summary> /// <param name="command"></param> /// <returns></returns> public override IEnumerator RunCommand(Yarn.Command command) { yield break; }
public override Yarn.Dialogue.HandlerExecutionType RunCommand(Yarn.Command command, global::System.Action onCommandComplete) { return(Yarn.Dialogue.HandlerExecutionType.ContinueExecution); }
public override Yarn.Dialogue.HandlerExecutionType RunCommand(Yarn.Command command, System.Action onCommandComplete) { _ui?.OnCommand(command.Text); return(Yarn.Dialogue.HandlerExecutionType.ContinueExecution); }