UI Toolkit VS Canvas - Performance & Comparison

Поділитися
Вставка
  • Опубліковано 25 чер 2024
  • UI Toolkit is Unity's new solution for building UIs. I will compare the performance of UI Toolkit and Canvas, to see which solution is better. I will also discuss the pros and cons of using UI Toolkit, so you know if you should use UI Toolkit for your Unity games.
    Discord Community - / discord
    Patreon - / freedomcoding
    PayPal - jani.steckerova@seznam.cz
    Are you looking for a Unity/C# tutor? Contact me here - marek.freedom.coding@gmail.com
    Website - www.freedom-coding.com
    Facebook - profile.php?...
    UI Pack1 - assetstore.unity.com/packages...
    UI Pack2 - opengameart.org/content/ui-pa...
    Timestamps:
    00:00 Intro
    00:22 Static UI Performance Comparison
    02:19 Dynamic UI Performance Comparison
    04:18 Conclusion - Performance
    04:48 Pros Of UI Toolkit
    05:41 Cons Of UI Toolkit
    06:47 Conclusion

КОМЕНТАРІ • 15

  • @NongBenz
    @NongBenz 4 місяці тому +2

    I'm converting my old UI components to the new UIElements and it's pretty smooth. And since it based on the widely used html/css structure (uxml/uss in Unity), it's easy to look up formatting tricks or get AI to help you on styling rules. UIElements does have a more complex layout engine so it's no surprise it does hiccup under any kind of styling/structure change but ultimately its been very precise and stable for me. Likely because Unity themselves rely on it for the actual UI of their Engine whereas the old UI components basically feel legacy and have log of odd bugs just due to code rot or the complex Jenga stack of components you need to mix up.
    But like you said the key seller for me was styling sheets that make consistent UIs or changing themes much easier.

    • @freedomcoding
      @freedomcoding  4 місяці тому +1

      That is true. Thanks for sharing your experience.

  • @chethanvenkataramaiah6940
    @chethanvenkataramaiah6940 2 місяці тому +1

    Many,complicated animation is possible from a package called UITTimeline. Also for referencing u use strings I would recommend copy paste, though that might be quite irritating if it has to be done for lot of things. Unity should go something so that the styles or visual elements can be suggested by intellisens. But for ur age ur doing great. I only would say enjoy more at this age as this age will not come back

    • @freedomcoding
      @freedomcoding  2 місяці тому

      Thanks for noting that. I will try it if I get back to UI toolkit. Yes I hope Unity will improve on that. Thanks!

  • @lemetamax
    @lemetamax 4 місяці тому +3

    I really need to learn the UI toolkit. But I'm afraid I'll be stuck looking for documentation and example use cases on some intermediate to advanced topics on it. And then there's the string issue. I hate strings and only use them when absolutely necessary.

    • @freedomcoding
      @freedomcoding  4 місяці тому

      Yeah there is not much documentation on it right now. But if you decide to code your UI, it is similiar to html and css.

    • @lemetamax
      @lemetamax 4 місяці тому +1

      @@freedomcoding that sucks. I'll put a pin on that for now until the tasks I have at hand are completed or I see it get to a "good enough" state. It has some potential though.

  • @stormer268
    @stormer268 3 місяці тому +3

    I have tried UI Tookit before. I personally don't think it's easy to use. It is neither as flexible as HTML and CSS, nor as user-friendly as Cavas. Especially in terms of documentation, it is very unclear, and sometimes you may find several methods but none that are suitable for your situation.

    • @freedomcoding
      @freedomcoding  3 місяці тому +1

      You are right. There are a lot of features missing compared to HTML, CSS or canvas. We will see what Unity does with it in the future.

  • @Fralleee
    @Fralleee 3 місяці тому

    Keep in mind that it's a huge difference if you're animating by changing position (margin, left, top etc) or by translating.
    Changing position will cause the entire UI to recalculate positions and re-render.
    While changing translate won't affect anything else.

    • @freedomcoding
      @freedomcoding  3 місяці тому

      Thanks for noting that. I certainly wasnt changing the margin and padding, but I am not sure if I changed position or used translate. I will keep that in mind.

  • @fineallday
    @fineallday 4 місяці тому

    I'm working with UI Toolkit at the moment, and one thing I don't like is that we cannot send parameters with buttons.We can subscribe to the click event but since there is no option for parameters you end up needing one function per button...

    • @freedomcoding
      @freedomcoding  4 місяці тому

      That is true. There is still quite a lot of functionality missing...

  • @Sim2322
    @Sim2322 3 місяці тому

    You seem like a bright young promising kid. I can tell you'll cringe in 10 years when you get sone real experience and deeper knowledge.
    Also, you can 100% make your own custom components to UI toolkit and add variables, custom behaviors, etc., as well as search by classes, not only strings.
    Takes a while to get used to, but it's much higher potential, both in performance and usability, than the old gui solutions.

    • @freedomcoding
      @freedomcoding  2 місяці тому

      Thanks, I know there is still a ton of stuff to learn. Thanks for pointing that out!