Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Clone a C# created hierarchy?

Discussion in 'UI Toolkit' started by Guedez, Jul 7, 2020.

  1. Guedez

    Guedez

    Joined:
    Jun 1, 2012
    Posts:
    497
    Should I make a method that generates said hierarchy when I need it, or there is a way to 'cache' it and clone on demand?
    I see that it's easy to do with UXML hierarchies, but I couldn't figure out the equivalent for C# created ones
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    945
    There is no such clone feature. This is exactly what UXML was made for - cloning. The only C# alternative is indeed, as you said, a function that generates a hierarchy.
     
unityunity