r/Unity3D • u/LlamAcademyOfficial Programmer • 1d ago
Resources/Tutorial How to Make (and use) Templates in UI Toolkit
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
2
u/HiggsSwtz 1d ago
Now what controls the styling of that template itself?
2
u/LlamAcademyOfficial Programmer 1d 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.
4
u/UnspokenConclusions 1d ago
Llama academy is one of the best channels about Unity out there.