ui-toolkit-manual-code-examples icon indicating copy to clipboard operation
ui-toolkit-manual-code-examples copied to clipboard

THE CODE IN THIS REPO DOES NOT WORK

Open netlander opened this issue 3 years ago • 3 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.

netlander avatar Aug 08 '22 11:08 netlander

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

netlander avatar Aug 09 '22 09:08 netlander

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).

lilisha-unity avatar Aug 09 '22 15:08 lilisha-unity

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");

bradley-newman avatar Jun 08 '24 21:06 bradley-newman