Class SerenityAddressableAttribute
Opt-in marker for a project (non-Serenity) ScriptableObject type: Serenity's Addressables
auto-labeler registers assets of this type as Addressable and applies the given label(s), so they become
discoverable at runtime via UnityAssetUtils.LoadAllFromAnyBlocking<T>(label) — no manual
Inspector reference. Serenity's own types are labeled automatically and don't need this.
Implements
Inherited Members
Namespace: Serenity.Shared.Attributes
Assembly: Serenity.Shared.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class SerenityAddressableAttribute : Attribute, _Attribute
Remarks
Usage:
[SerenityAddressable("project:content")]
public class ContentDatabase : ScriptableObject { /* ... */ }
Then at boot: UnityAssetUtils.LoadAllFromAnyBlocking<ContentDatabase>("project:content").
Constructors
SerenityAddressableAttribute(params string[])
Marks the type Addressable under the given label(s).
Declaration
public SerenityAddressableAttribute(params string[] labels)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | labels | One or more Addressables labels. |
Properties
Labels
Declaration
public string[] Labels { get; }
Property Value
| Type | Description |
|---|---|
| string[] | The Addressables label(s) applied to assets of the decorated type. At least one is required. |