Search Unity

Feature Request Autogenerating query script in UI Builder

Discussion in 'UI Toolkit' started by jiungerich, Jan 25, 2023.

  1. jiungerich

    jiungerich

    Joined:
    Jul 26, 2019
    Posts:
    18
    Since UI Toolkit requires a lot of boilerplate queries to be able to reference the elements in code. It would be great to just autocreate those queries to cut and paste from a window in UI Builder. This could either be for individual elements or for the whole current document. Just like it autocreates a UXML file, just have another window with C# code that references the elements. You could have an inspector window check box that toggles weather the boilerplate query for the element is generated. A standard visual element would be default off and a button would likely be default on, etc. Even better for button etc. to have some boiler plate for clicked. This doesn't have to be an actual script file just something temporary like the console output that I can copy and paste from.

    This would save me a fair amount of the initial headache of setting up documents and panels to be referenced by code.
     
    MaskedMouse and oscarAbraham like this.