Unity-Technologies / ui-toolkit-manual-code-examples

Unity UI Toolkit documentation code examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

THE CODE IN THIS REPO DOES NOT WORK

netlander opened this issue · comments

Great to see some examples for the new UI Toolkit. However, what would be really helpful is to make the entire repo as a Unity project and add a sample scene to each example.

Currently there are class name conflicts that are preventing the import of the entire repo into a single Unity project.

If the decision is taken to go with the above mentioned conversion I might find time to assist.

It seems that most of the code is Editor UI and NONE OF IT WORKS.

hi @netlander, thank you for your feedback. The code in this repo won't work by itself. This repo's code examples are for the UI Toolkit user manual. You must follow the steps in the user manual in order to have the code work. For example, this page teaches you how to create a drag-and-drop UI inside a custom Editor window. You can either copy/paste the code on the page or get the files from this repo (https://github.com/Unity-Technologies/ui-toolkit-manual-code-examples/tree/master/create-a-drag-and-drop-window-inside-a-custom-editor-window).

would be nice if the examples were organized by assembly definitions to avoid the need to import each example separately. And used relative paths for assets instead of the hard coded paths like this:

var visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/Editor/DragAndDropWindow.uxml");