GithubHelp home page GithubHelp logo

ui-toolkit-manual-code-examples's Introduction

UI Toolkit Manual Code Examples

This repo includes the code examples for Unity's UI Toolkit documentation. The code examples in this repo don't work by themselves and the repo doesn't include any project files.

You must follow the steps in the UI Toolkit user manual to create the examples. You can create the examples with any Unity template and with the sample scene. Most of the examples were created with Editor UI for demo purposes, but they will work for runtime UI.

Editor UI examples

Runtime UI examples

Custom controls examples

Basic binding examples

Advanced binding examples

UI controls examples

Transition examples

Drag-and-drop UI examples

Vector UI examples

ui-toolkit-manual-code-examples's People

Contributors

lilisha-unity avatar peter-finn-unity avatar repodb[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui-toolkit-manual-code-examples's Issues

compilation errors in 2021.3.9f1 - 2D URP

C:\Users\VP\Unity Projects\UNity - UI Toolkit Dragons - 2D URP\Library\PackageCache\[email protected]\Runtime\SpriteShapeGenerator.cs(1157,21): Burst error BC1055: Unable to resolve the definition of the method UnityEngine.U2D.Common.UTess.ModuleHandle.Tessellate(Unity.Collections.Allocator, Unity.Collections.NativeArray1<Unity.Mathematics.float2>, Unity.Collections.NativeArray1<Unity.Mathematics.int2>, ref Unity.Collections.NativeArray1<Unity.Mathematics.float2>, ref int, ref Unity.Collections.NativeArray1<int>, ref int, ref Unity.Collections.NativeArray1<Unity.Mathematics.int2>, ref int)`

at UnityEngine.U2D.SpriteShapeGenerator.TessellateContour(UnityEngine.U2D.SpriteShapeGenerator* this) (at C:\Users\VP\Unity Projects\UNity - UI Toolkit Dragons - 2D URP\Library\PackageCache\[email protected]\Runtime\SpriteShapeGenerator.cs:1113)
at UnityEngine.U2D.SpriteShapeGenerator.Execute(UnityEngine.U2D.SpriteShapeGenerator* this) (at C:\Users\VP\Unity Projects\UNity - UI Toolkit Dragons - 2D URP\Library\PackageCache\[email protected]\Runtime\SpriteShapeGenerator.cs:2562)
at Unity.Jobs.IJobExtensions.JobStruct`1<UnityEngine.U2D.SpriteShapeGenerator>.Execute(ref UnityEngine.U2D.SpriteShapeGenerator data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex)


Library\PackageCache\[email protected]\Runtime\SpriteShapeGenerator.cs(1157,117): error CS1620: Argument 5 must be passed with the 'out' keyword
Library\PackageCache\[email protected]\Runtime\SpriteShapeGenerator.cs(1157,134): error CS1620: Argument 7 must be passed with the 'out' keyword
Library\PackageCache\[email protected]\Runtime\SpriteShapeGenerator.cs(1157,152): error CS1620: Argument 9 must be passed with the 'out' keyword

Element 'ChartLibrary.RadialCounter' has no registered factory method.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Element 'MyUILibrary.SlideToggle' has no registered factory method.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Element 'UIToolkitDemo.HealthBarComponent' has no registered factory method.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

THE CODE IN THIS REPO DOES NOT WORK

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.

Display

On the tabs we do the .unselectedContent with display: none, but we never reactivate the display when switching, I went ahead and added a content.style.display = DisplayStyle.Flex on it to show the content on the SelectedTab.

Please specify Unity version with which this code is compatible

Could you add Unity version which is compatible with this code in Readme.md, since for ex., this code doesn't compile with 2020.3.

For ex.,
Assets\create-listviews-treeviews\PlanetsWindow.cs(110,28): error CS0246: The type or namespace name 'TreeViewItemData<>' could not be found (are you missing a using directive or an assembly reference?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.