Search Unity

Is it a good idea to mix UI Toolkit and uGUI?

Discussion in 'UI Toolkit' started by One_Learning_Man, Oct 9, 2021.

  1. One_Learning_Man

    One_Learning_Man

    Joined:
    Sep 30, 2021
    Posts:
    81
    In building a UI system for an RPG, I was thinking of adopting UI Toolkit and go as far as I can with it and whatever I can't do with it to have uGUI handle it. Is this a good idea or is it better to exclusively use one system and stick with it?
     
  2. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    Every layer has a performance cost to it. So while you can mix them, you will lose performance if you have more than 2 layers (one in front of another in front of another in front of another, etc). Also it's hard to get the scale and positions to match since they each have their own layout systems, so it's a lot of work if you want a UGUI control (eg a slider or something) to fit into the layout of a UITK panel. AFAIK, events are handled properly (ie you won't get click-through).

    For example, I'm doing a bottom layer of uGUI for one thing that's impossible with toolkit*, and then toolkit for all the menus and stuff above that. It works well enough for now, but my game UI isn't super complex.

    * (TextCore doesn't expose all the same properties as TextMeshPro, so if you need to control/measure text on a character-by-character basis then you need to use uGUI for those).
     
    Last edited: Oct 10, 2021