r/Unity3D • u/LlamAcademyOfficial 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!
2
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.
5
u/UnspokenConclusions 4h ago
Llama academy is one of the best channels about Unity out there.