Class UITKDialogInputBox
UI Toolkit input dialog. Shows a message with a text field and accept/cancel buttons, invoking a callback with the entered text.
public class UITKDialogInputBox : UITKCallbackDialog
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKDialogInputBox
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Shares the open/close callback rules with UITKDialogBox through
UITKCallbackDialog. This panel is where getting them wrong hurt most: it
used to hide on Accept with an empty field and invoke neither callback, and its two live
callers — the account-verification prompt and the TOTP prompt in UITKLogin — have
hidden the login panel and locked sign-in by the time it opens. An answer that never
arrives left the client with no visible panel and no way back to the login screen.
Methods
ApplyRequest()
Writes the current request's message into the live tree and empties the field.
protected override void ApplyRequest()
Remarks
The field is cleared here rather than in Open(string, Action<string>, Action) so the previous prompt's answer — a verification code, a password — cannot survive into the next one on the re-cloned tree.
CancelRequest()
Answers the request down its cancel path. Escape, quit-to-login, an empty accept and a bare Hide() all arrive here.
protected override void CancelRequest()
ClearRequest()
Drops the callbacks, the message and the typed text this request was opened with.
protected override void ClearRequest()
FocusDefault()
Puts the caret in the field, which is the only thing the player can usefully do here.
protected override void FocusDefault()
OnStarting()
Resolves cached elements and wires button callbacks.
public override void OnStarting()
OnSubmitKey()
Enter submits, which is what a player typing a code expects.
protected override void OnSubmitKey()
Open(string, Action<string>, Action)
Opens the input dialog with the specified message and optional callbacks.
public bool Open(string text, Action<string> onAccept = null, Action onCancel = null)
Parameters
textstringMessage to display.
onAcceptAction<string>Optional callback invoked with the entered text when accepted.
onCancelActionOptional callback invoked when cancelled.
Returns
- bool
False when a prompt was already on screen and this one was refused. A refused request is answered immediately through
onCancel.
Open(string, bool, Action<string>, Action)
Opens the prompt, optionally masking what the player types.
public bool Open(string text, bool masked, Action<string> onAccept = null, Action onCancel = null)
Parameters
textstringThe message shown above the field.
maskedboolTrue when the answer is a secret — an account password, a recovery passphrase — and must not be rendered in clear text.
onAcceptAction<string>Optional callback invoked with the entered text when accepted.
onCancelActionOptional callback invoked when cancelled.
Returns
- bool
False when a prompt was already on screen and this one was refused. A refused request is answered immediately through
onCancel.
Remarks
This overload exists because the recovery-code store needs the account password to derive its decryption key, and the only prompt available rendered it in clear text on screen. Masking is off by default so every existing caller keeps its current behaviour.