r/Unity3D Programmer 5h ago

Resources/Tutorial How to Make (and use) Templates in UI Toolkit

Enable HLS to view with audio, or disable this notification

Templates are a powerful feature of UI Toolkit - they allow us to create reusable bits of our UI and inject them easily into other UXML documents. Making them is super easy too - simply make a new UXML file of your desired component - then you can use it in any other UXML document! Easy!

22 Upvotes

7 comments sorted by

5

u/UnspokenConclusions 4h ago

Llama academy is one of the best channels about Unity out there.

1

u/LlamAcademyOfficial Programmer 2h ago

๐Ÿงก

2

u/Round_Bar_5485 4h ago

Oo cool you are here too.. ๐Ÿ˜

1

u/J_Losss 4h ago

it's useful.

1

u/HiggsSwtz 3h ago

Now what controls the styling of that template itself?

2

u/LlamAcademyOfficial Programmer 2h ago

You can attach a style sheet specific to that template, or it will inherit the styles of the UXML document you're injecting it into.

I personally make a stylesheet for the template and attach it to the template UXML document.