Installation¶
First, you have to import uss.unitypackage.
Setup¶
Once you import the package, there will be UssRoot in Canvas object.
If there isn’t, please add UssRoot component to Canvas.
ussroot
Next, create a ucss file to somewhere proper place. (ex: Assets/Resources/default.ucss)
ucss_slot
There’s a Ucss slot in UssRoot.
Drag the .ucss file you just created to the Ucss.
You can specify different files for each scene.
Load ucss with code¶
You can also load ucss in with code.
var ucss = System.IO.File.ReadAllText("PATH_TO_LOAD");
UssStyleModifier.LoadUss(ucss);
LoadUss can be executed in runtime. But this can hang your application in few moments.