Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Official Share your UI Toolkit projects

Discussion in 'UI Toolkit' started by antoine-unity, Sep 30, 2020.

  1. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    485
    Last edited: May 16, 2022
    Fep310, tmars, DigitalGlass and 9 others like this.
  2. PassivePicasso

    PassivePicasso

    Joined:
    Sep 17, 2012
    Posts:
    100
    I've been building a MarkdownElement for UIToolkit in the Editor, powered by xoofx's awesome Markdig library, for use in many of my projects. Currently compatible with Unity 2018-2022
     

    Attached Files:

    Last edited: Sep 16, 2022
    Fep310, _geo__, oscarAbraham and 10 others like this.
  3. CareyMcDuff

    CareyMcDuff

    Joined:
    Dec 14, 2021
    Posts:
    1
    Could you please explain why Queries should be in OnEnable instead of Awake? Most example I have seen online put the queries in Awake. According to the Unity Manual, OnEnable is called immediately after Awake. Is it that the Visual Tree Asset is not instantiated until OnEnable?
     
  4. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Exactly! For now the implementation of UIDocument only instantiates the root visual element during OnEnable. We have discussed maybe changing the pattern but for now nothing concrete has come of it so that's how it'll work. If you have further questions/discussions you want to have please start a new thread though as we want to keep this one focused on sharing projects :cool:
     
    Eastrall, mariandev and CareyMcDuff like this.
  5. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Making a channel-packer editor tool using UTK and GraphView, still early but promising :)

     
  6. SolarianZ

    SolarianZ

    Joined:
    Jun 13, 2017
    Posts:
    215
    Last edited: Mar 7, 2023
    rawna and RunninglVlan like this.
  7. Dream_Code_TM

    Dream_Code_TM

    Joined:
    Jul 19, 2013
    Posts:
    37
    Allows store android keystore between sessions, without manual input everytime.
    Keystore data will be autocomplete on build stage
    GitHub
     
    bb8_1 likes this.
  8. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    164
    I am going to convert UI from UGUI to UITK.
    I use Localization and Zenject package at the same time before.
    So I make a small project to reproduce same function when I use UGUI, Localization and Zenject.
    I write a custom visual element to send Zenject signal to trigger other visual element to display image and description.
    And use Localization to localize description text.
     
    Last edited: Oct 21, 2022
    antoripa, karl_jones and goldbug like this.
  9. Eastrall

    Eastrall

    Joined:
    Dec 14, 2020
    Posts:
    29
    Hi,

    sorry to bump this thread by replying to my own message, but just want to showcase the new Rosalina feature, which is the possibility to create UI bindings and scripts for Unity's EditorWindow ! :)
    All you have to do is set the "editor-extension-mode" to "true" in the UXML definition or check the "Editor Extension Authoring" checkbox in UI Builder:



    This will generate the following UI binding script:
    Code (CSharp):
    1. // <autogenerated />
    2. using UnityEditor;
    3. using UnityEngine;
    4. using UnityEngine.UIElements;
    5.  
    6. public partial class CustomEditorWindow : EditorWindow
    7. {
    8.     public Button SampleButton { get; private set; }
    9.  
    10.     public void CreateGUI()
    11.     {
    12.         VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/...");
    13.         VisualElement ui = asset.CloneTree();
    14.         rootVisualElement.Add(ui);
    15.         SampleButton = (Button)rootVisualElement?.Q("SampleButton");
    16.         OnCreateGUI();
    17.     }
    18.  
    19.     partial void OnCreateGUI();
    20. }
    Then you can override it and control how the window opens by creating a UI Script (with a right click on the UXML file and select "Generate UI Script" under the "Rosalina" menu item) :

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3. using UnityEngine.UIElements;
    4.  
    5. public partial class CustomEditorWindow : EditorWindow
    6. {
    7.     [MenuItem("Window/My Custom Editor Window")]
    8.     public static void ShowWindow()
    9.     {
    10.         EditorWindow.CreateWindow<CustomEditorWindow>("My Custom Editor Window!");
    11.     }
    12.  
    13.     partial void OnCreateGUI()
    14.     {
    15.         SampleButton.clicked += OnSampleButtonClicked;
    16.     }
    17.  
    18.     private void OnSampleButtonClicked()
    19.     {
    20.         Debug.Log("Hello world!");
    21.     }
    22. }
    Final result when clicking on "Window -> My Custom Editor Window":


    Check out the documentation on GitHub : https://github.com/Eastrall/Rosalina#editor-window :)


    Eastrall
     
    Last edited: Nov 29, 2022
    bb8_1, Ruchir and RunninglVlan like this.
  10. Midiphony-panda

    Midiphony-panda

    Joined:
    Feb 10, 2020
    Posts:
    235
    You should post this in the Timeline forum : the Graph Visualizer is completely outdated and your tool should be useful to many :)
     
  11. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,085
    As a project to learn UI Toolkit I decided on simply replicating Game Dev Tycoon. It is essentially a GUI game, and a lot of fun too and not one of those ewwwwww mobile cash-grab pseudo-games (aka what DragonCrashers replicates). I know this is where the money is, but I'm more after where the fun is. :p

    upload_2022-12-10_13-57-1.png

    Ultimately, I want to be able to design mangement game GUIs which are only suitable for desktop screens, since you'll have a lot of lists, graphs, stats, financial sheets, and so on.
     
    RunninglVlan likes this.
  12. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    164
    I made a setting menu with UITK.
    Still use Localization and Zenject together. :p
     
  13. Nefisto

    Nefisto

    Joined:
    Sep 17, 2014
    Posts:
    324
    I've made a debugger for my drop manager tool Loot

     
    Randolphjand and mariandev like this.
  14. m-guntrum

    m-guntrum

    Joined:
    Mar 14, 2013
    Posts:
    6
    We recently created NewGraph a data-oriented node graph solution for Unity powered by UIToolkit (UIElements). It is based on the idea to visualize complex data structures as graph networks without having to modify already established data classes, except adding [Node], [Port], [PortList] and [SerializeReference] attributes to all classes that should show in the Graph View.


    Link to GitHub project

    Features
    • WYSIWYG. A port connecting to a node in the graph is a real reference to the object in your graph .asset
    • Good performance even with many nodes as this is built upon the new retained UIToolkit UI system.
    • create visual data oriented networks based on your custom [Serializable] data classes simply by adding attributes.
    • Fully serialized dynamic lists of ports with the [PortList] attribute.
    • Customize data visualization with [GraphDisplay]: Display a field inside the graph, side inspector or both views.
    • Full support of Unity's native Undo/Redo stack.
    • Support for Utility Nodes that can be created to help organize your specific graph business.
    • Copy & Paste even across graphs.
    • No child ScriptableObject mayhem! A graph asset will hold all your data in one single scriptable object.
    • Cyclic references and complex reference chains are natively supported with the use of [SerializeReference] attribute.
    • No reliance on the now deprecated Experimental.GraphView. Everything was written from scratch or is based on maintainable code.
    • Keyboard shortcuts, a searchable context menu, default UtilityNodes like CommentNode, GroupCommentNode, a extensively commented code base and more...
    Wiki
    See the Wiki for installation & usage instructions.

    Changelog
    See the Changelog for current updates!
     
    quibit, zfh2773, Neonage and 2 others like this.
  15. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,085
    You mean like in UML?
    Is that data then modifiable in the graph, or does the graph only show the data scheme? Or does it even allow generating code?
     
  16. m-guntrum

    m-guntrum

    Joined:
    Mar 14, 2013
    Posts:
    6
    Yes the data is modifiable, think UML but operating on instances of your class. It is not meant to generate code but you might very well implement code generation based on you nodes in an additional step. It's a different way to look into the instances of your [Serializable] classes, structs and fields. It was designed especially for complex data structures like Mission Systems, Quest Systems, Dialog Systems or anything where one would benefit from visually seeing the references one class has to another.
     
  17. GiantGrey

    GiantGrey

    Joined:
    Jul 2, 2012
    Posts:
    261
    Happy to share my latest project I've been working on.
    It'll be a new asset for the AssetStore and is called Databrain. I made it completely from scratch with the new UIToolkit.
    It basically consists of a main data management editor and can be expanded with add-ons.

    Main editor
    MainEditor.png

    Logic add-on (High level visual scripting node editor)
    Logic.png

    - Made from scratch without the deprecated GraphView.

    Techtree add-on
    Techtree.PNG

    Stats add-on
    Stats.png

    Localization add-on
    Localization.png

    It's still under development but I plan to release it very soon.
    For more information check out the website here:
    https://databrain.cc

    Additionally I want to say that I love creating editor tools with the new UIToolkit! I made quite a lot of tools with IMGUI and was very sceptical at first. But now I don't want to go back :)
     
  18. Predulus

    Predulus

    Joined:
    Feb 5, 2018
    Posts:
    89
    Those panels look really good. Very polished.
     
  19. stevphie123

    stevphie123

    Joined:
    Mar 24, 2021
    Posts:
    74
    quibit, Fep310, _geo__ and 3 others like this.
  20. SoyWar

    SoyWar

    Joined:
    Feb 20, 2021
    Posts:
    4
    I present you a new asset named "UI Toolkit Component", which was originally a feature designed for my game under development.



    This asset allows you to use UI Toolkit with components using a selector similar to the stylesheets of the UI Builder. The attachment of elements to components is done dynamically, and most of the CSS pseudo-classes are usable on the selector. It is also possible to apply stylesheets when an element is attached to a component, and to use events related to the value and state of the element, such as changing the text of a "Label", clicking a "Button" or selecting a "RadioButton" in a "RadioButtonGroup".

    Here is an example of how to integrate the Localization package with UI Toolkit without needing any coding knowledge:



    You can find it here: https://assetstore.unity.com/packages/slug/239489
     
    bb8_1, PolyCrusher and mariandev like this.
  21. BennyKokMusic

    BennyKokMusic

    Joined:
    Dec 22, 2016
    Posts:
    32
  22. SolarianZ

    SolarianZ

    Joined:
    Jun 13, 2017
    Posts:
    215
  23. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    927
  24. felipemullen

    felipemullen

    Joined:
    Mar 4, 2017
    Posts:
    44
    Coming back to ui toolkit because I like self inflicting pain.
    And then I see this: https://assetstore.unity.com/packages/tools/gui/onejs-221317

    Holy smokes! This is exactly what I thought I would get when I started using uitk! Has anyone here had any success with onejs?
    @uDamian / @benoitd_unity can you guys just buy up this dude's project so we can use it standard in unity? If it works the way it looks, it might just save the awful experience that is UI in unity.
     
    RunninglVlan likes this.
  25. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,218
    Well... I mean...




    Maybe it's just me, but I think UI Toolkit is fantastic. Though, at the same time, I would rather slam my dongle in a car door than have to use typescript and any js framework.
     
    bb8_1 and Lurking-Ninja like this.
  26. felipemullen

    felipemullen

    Joined:
    Mar 4, 2017
    Posts:
    44
    What you choose to do with your dongle is entirely up to you my guy

    But that highlighted section in your image is exactly the reason why I wrote my message. If some random person (people?) can implement hot reloading, proper component transformation to ui elements with support for tailwind, what is the unity team doing? When I first started tracking UITK back at Damiens speech in 2019 I was super excited. As you can guess, I no longer am.

    Languages/toolsets each should be used according to their purpose, and they can improve or hinder your productivity. What I can say for certain is that Unity doesn't have a good track record with UI, and the web stack is purely based around UI. It is silly to look at the current state of web dev and pretend there is nothing to learn from it.
     
    Last edited: Jul 12, 2023
    Unifikation likes this.
  27. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,923
    Writing the whole system so your asset can claim that they are doing anything.

    Unity doesn't need another scripting language, C# is plenty good.
     
    Armynator and Eastrall like this.
  28. ChebanovDD

    ChebanovDD

    Joined:
    Mar 27, 2022
    Posts:
    7
    My UI Toolkit projects :)

    UnityMvvmToolkit - brings data-binding to your Unity project
    UnityWidgetsToolkit - create UI using widgets similar to Flutter's approach
    UnityUxmlGenerator - generates "UxmlFactory" and "UxmlTraits" source code for a custom VisualElement

     
    Fep310, bb8_1, PolyCrusher and 4 others like this.
  29. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    69
    We've been using UI Toolkit for the last ~2 years in our (unreleased) game "The Tribe Must Survive".
    Currently, we have a a Alpha Playtest going on Steam, so people can try it out for free.

    I thought this would be a good opportunity to show how we use UI Toolkit.

    If you want to join the Playtest, you are required to join our discord though:
    https://discord.gg/TfzRNz4GK6
     
    Last edited: Sep 21, 2023
  30. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,115
    Am currently working on a new (paid) asset for shadows, glow and outlines (with animations).

    upload_2023-9-27_22-47-14.png

    Some Screenshots:​

    OutlineAnimation.gif
    The shadow in the image above is faked via a glow. Below you can see how a real shadow looks.
    upload_2023-9-27_22-46-53.png

    Glow and outline effects are added via Manipulators so the workflow can be none-destructive.

     
    Last edited: Oct 3, 2023
    Fep310, uMathieu, bb8_1 and 3 others like this.
  31. JasonsFreeTime

    JasonsFreeTime

    Joined:
    May 23, 2015
    Posts:
    31
  32. okndmrl

    okndmrl

    Joined:
    May 25, 2019
    Posts:
    2
    Hey I really would like to know how you made editor windows inside editor windows. Thats what I am looking for actually and I been searching for a quite long time for it.
     
  33. JasonsFreeTime

    JasonsFreeTime

    Joined:
    May 23, 2015
    Posts:
    31
    I'm also interested in this capability. One issue for me regarding the ability for a user to input and format text at runtime is that currently the TextField does not support rich text tags.

    Here is a screenshot from the 2023.3 Unity manual:

    upload_2023-10-10_21-24-20.png

    I would love to know where this is at on the road map for coming in the future. I hope it IS coming soon!

    Otherwise, if anyone has any suggestions for how to pull this off, I would appreciate it!
     
  34. ShokWayve

    ShokWayve

    Joined:
    Jan 16, 2013
    Posts:
    122
    You are using Unity to create an app that is not a game? I am curious. Who is the intended target? Is this a productivity tool that will be available on App Stores? Will your app have user comments?

    Thanks.
     
  35. ShokWayve

    ShokWayve

    Joined:
    Jan 16, 2013
    Posts:
    122
    Should we still use On Enable? My code seems to work when I query everything in Awake.

    Thanks.
     
  36. ShokWayve

    ShokWayve

    Joined:
    Jan 16, 2013
    Posts:
    122
    Greetings. The app looks great.

    Two questions if you don't mind:

    May I ask why you used Unity for a non-game app? I am really thinking about using Unity to create a non-game app and so I am wondering if that's easy to do, is the file size very large, is it hard to do dialog or text input fields, etc.

    Is your UI Toolkit version of the App now in the Google Play store?

    Thanks.
     
  37. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    157
    Hi @ShokWayve,
    I asked similar question, Here is the link:

     
  38. ShokWayve

    ShokWayve

    Joined:
    Jan 16, 2013
    Posts:
    122
    Thanks. However, there was not a link. When you post the link I will follow it.

    Thanks again.