Search Unity

Creating new UI controls

Discussion in 'UI Toolkit' started by MostHated, Sep 9, 2020.

  1. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Heya,
    I was playing around with the UI Builder to prototype a menu and saw that the default controls were all grayed out and changes were not allowed in the UI Builder so I wanted to make a new type of Foldout and thought that the easiest way to start would be to just take the current one, make a copy, and then go from there.

    Unfortunately, it looks like there is usage of internal methods that would prevent this from being that easy. (such as SaveViewData(), OnViewDataReady(), etc).

    Are there any examples of the best way to go about handling this, or is there even anything in place to allow this while still maintaining "default" functionality to build from? (such as the above methods, or being able to be used in the UI Builder for prototyping and testing, etc and being able to be called just from a normal editor script: var customFoldout = new CustomFoldout(); )

    Thanks,
    -MH
     
  2. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235