Пример #1
0
            /// <summary>
            /// Creates a DialogueObject of type TextInput. Allows the player to input text into the conversation.
            /// </summary>
            /// <param name="name">Name of the person speaking</param>
            /// <param name="line">Dialogue the person says</param>
            /// <param name="contentType">Type of input to be entered into the text input field.</param>
            /// <param name="placeholderText">Text to be displayed in the input field before the player enters text</param>
            /// <param name="maxLength">Max length of the string to be entered. 0 = no max length.</param>
            /// <param name="enterInput">Function to be called when player advances dialogue. Function must be of type void and take in one string variable.</param>
            public DialogueObject(string name, string line, InputField.ContentType contentType, string placeholderText, int maxLength,
                                  EnterInput enterInput)
            {
                dialogueType = DialogueType.TextInput;

                speakerName           = name;
                dialogueLine          = line;
                inputContentType      = contentType;
                inputPlaceholderText  = placeholderText;
                maxInputLength        = maxLength;
                dialogueInputCallback = enterInput;
            }
Пример #2
0
 /// <summary>
 /// Displays a single line of dialogue with the input field. The player is the speaker.
 /// </summary>
 /// <param name="line">Dialogue line player speaks.</param>
 /// <param name="placeholderText">Text displayed in input field before input is entered</param>
 /// <param name="enterFunction">Function to be called when input is entered. Function must be of type void and take in a single string.</param>
 public void MainCharInputOneLiner(string line, string placeholderText, EnterInput enterFunction)
 {
     endDialogue       = null;
     curDialogueObject = new DialogueObject(playerName, line, InputField.ContentType.Alphanumeric, placeholderText, 16, enterFunction);
     ShowDialogue(curDialogueObject);
 }