Ejemplo n.º 1
0
    public void SetupOptions(Yarn.OptionSet optionsCollection, IDictionary <string, string> strings, System.Action <int> selectOption)
    {
        //Do the initial setup for the options
        IsInOptions      = true;
        optionSelected   = 0;
        optionsAvailable = optionsCollection;
        RightArrow.SetActive(true);
        dialogueUI.SetIsInOptions(true);
        dialogueUI.SetWaitingForOptionSelection(true);
        dialogueUI.SetcurrentOptionSelectionHandler(selectOption);
        dialogueUI.CallOnOptionsStart();

        //This is to handle localisation, but I'm not doing that yet

        /*
         * if (strings.TryGetValue(optionsCollection.Options[0].Line.ID, out var optionText) == false)
         * {
         *  Debug.LogWarning($"Option {optionsCollection.Options[0].Line.ID} doesn't have any localised text");
         *  optionText = optionsCollection.Options[0].Line.ID;
         * }
         */
        //Show the first option
        dialogueRunner.HandleLine(optionsCollection.Options[0].Line);
    }