Phase 5 updates

Phase 5 · Slice 9 ·

Text entry and dropdowns

  • InputField and TMP_InputField, sharing one editing core:
    • typing with validation by content type (integer, decimal, alphanumeric, name, email; TMP's digit, regex and custom validators) and the character limit;
    • Backspace and Delete, and moves by character, word, line and to start or end, with Shift selecting;
    • select all, copy, cut and paste (an in-process clipboard), passwords, multi-line, and submit and cancel (restoring the text);
    • activation at the end of the frame, selecting all, and focus moving between fields (onEndEdit);
    • the label refreshed as Unity refreshes it, scrolled to keep the caret in view;
    • mouse caret placement and drag selection, and a drawn caret (blinking) and selection.
  • Dropdown and TMP_Dropdown:
    • the list is a copy of the template, with an item per option, sorted on top (30000);
    • a blocker closes it; picking an item sets the value; it fades out and is destroyed.
  • DefaultControls and TMP_DefaultControls build every standard control with Unity's names, sizes and wiring.
  • Text input:
    • Input.inputString, a per-frame IMGUI Event queue (Event.PopEvent, Event.KeyboardEvent), GUIUtility.systemCopyBuffer, and Keyboard.onTextInput;
    • the player window's typed characters, and MCP's play_step text input.
  • Also:
    • Transform sibling order (GetSiblingIndex, SetSiblingIndex, SetAsFirstSibling, SetAsLastSibling) and Object.hideFlags;
    • GetComponentInChildren searching below inactive objects as Unity does;
    • cloning keeps RectTransforms (instantiating UI was broken), and cloned UnityEvents get fresh listener lists.
  • A new ui_input scenario recorded in Unity checks the following, and matches in both runs:
    • editing through ProcessEvent (caret, selection, deletes, validation, limits, multi-line, cancel), the label's refresh timing, and the order of activation and end-edit events;
    • TMP editing, and dropdown options, captions, the shown list, the blocker and picking. 35 scenarios pass.
  • An MCP e2e test clicks an input field, types, deletes and submits.
  • Not yet: IME composition, touch keyboards, the OS clipboard, rich text editing in TMP fields, and TMP's scrollbar and multi-select dropdowns.
  • Next: texture maps for PBR materials (normal, metallic, occlusion, emission) and the scene's RenderSettings ambient.