EchoTrio
 
Loading...
Searching...
No Matches
UserTextInput.cs
Go to the documentation of this file.
1using UnityEngine;
2
3namespace EchoTrio.UI {
4 [RequireComponent(typeof(TMPro.TMP_InputField))]
5 public class UserTextInput : MonoBehaviour {
6 [SerializeField] VoiceChat voiceChat = null;
7
8 private TMPro.TMP_InputField inputField = null;
9
10 public async void SubmitUserTextInput() {
11 string message = inputField.text.Trim();
12 if (0 < message.Length && await voiceChat.SubmitUserTextInput(message)) {
13 inputField.text = string.Empty;
14 }
15 }
16
17 private void Awake() {
18 inputField = GetComponent<TMPro.TMP_InputField>();
19 }
20
21 private void Start() {
22
23 }
24
25 private void Update() {
26
27 }
28 }
29}
async void SubmitUserTextInput()
TMPro.TMP_InputField inputField
Definition: UserTextInput.cs:8
async Awaitable< bool > SubmitUserTextInput(string message)
Submit the user text input. Used as an alternative to speaking into the microphone,...
Definition: VoiceChat.cs:132