Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[0.11.4-preview / Unity LTS] No TextInput and Build doesn't match Preview / PlayMode

Discussion in 'UI Toolkit' started by Daxten, Jun 13, 2020.

  1. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    8
    Hi!
    First of all, I think the new UI Toolkit is great and will be vastly superior over the old systems (maybe it is already).

    I have 2 Problems currently (maybe bugs?):

    1. I can't get Input for TextField to work, Hover effects are working on my Buttons, so I guess the EventSystem is working correctly. Marking the prefilled text inside the text box seems to mark a smaller text behind the text field. Hitting keys while marking this text doesn't do anything

    2. Play Mode / Preview Mode both layout my UI correctly. But after building the project all sizes/positions of my UI seem to be back to the defaults. Backgrounds and hover effects work (which are both defined inside the stylesheet)
     
  2. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    8
    Deleting the Library Folder seems to fix issue 2, I guess the new UI System isn't really propagating the changes through the cache and the old versions get reused if you don't cleanup the build folder
     
  3. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    8
    obviously I'm talking about 0.11.2-preview, sorry if someone got excited :p
     
  4. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    8
    the first problem can be fixed by switching to IMGUI Events on the EventSystem in my case. So might be a bug / missing feature?

    The carret in the text input is still bugged though (keeps default size)
     
  5. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    945
    A couple of general notes:
    1. It's worth noting that UI Builder is not the same as UI Toolkit. UI Builder is just a tool that can helps you create UXML/USS UI assets, but the end result is the same if you used a normal text editor. I assume you're talking about UI Builder from the version number you provided.

    2. UI Builder requires explicit Saving in order to commit any changes to disk. I'm not sure if this is the cause of your issue 2 but worth mentioning. You'll see a * beside all the modified files in the Builder, like the Hierarchy or Canvas, when there are unsaved changes. You can save via the File menu in the Builder's own Viewport pane.

    3. It sounds like you're creating runtime UI. Please correct me here if I'm off. If so, please try the official (new) package for UI Toolkit that includes runtime support. Details here:
    https://forum.unity.com/threads/ui-toolkit-1-0-preview-available.927822

    Let us know if you're still having issues after updating to the above package (as well as the latest UI Builder package, a separate package, which is at 1.0.0-preview.1 now)
     
unityunity