HaikaraUI Attribute
[HaikaraUI]
is an attribute required to recognize a class as being associated with a .uxml (or .uss) file.
The SourceGenerator first collects classes that have this attribute.
Parameters
Parameter | Type | Required | Default Value |
---|---|---|---|
ReferenceMode | AssetReferenceMode | no | AssetReferenceMode.Resource |
- ReferenceMode
ReferenceMode
determines where to load the UI asset (VisualTreeAsset
orStyleSheet
) from.- Resource
IfResource
is specified, the actual UI asset will be registered in theUICatalog
and instantiated at load time. - AssetPath (Editor Only)
IfAssetPath
is specified, the asset path will be registered in theUICatalog
.
The asset will be loaded from the path usingUnityEditor.AssetDatabase.LoadAssetAtPath<T>()
. - Custom
UI loading will be performed using a user-definedUILoader
.
IfCustom
is specified, you must register the definedUILoader
with theUICatalog
.
Reference:AddressablesUILoader
- Resource