Summary
The
Weaver.AssetInstanceAttribute
causes this field to show up in the Weaver Window so the user can
assign a prefab to it (specifically, a prefab with a Weaver.Examples.FrameRate
component on it). Then Weaver
will automatically instantiate a copy of that prefab on startup and assign it to this field.
- Assembly
- Weaver
.dll - Namespace
- Weaver
.Examples - Containing Type
- FrameRate
Syntax
[AssetInstance(Optional = true)]
public static readonly FrameRate Instance
Remarks
This could be a private field, but having it public means other scripts can disable it if you want. We
could have also used an
Weaver.AssetReferenceAttribute
to just get a reference to the chosen prefab
and then instantiate it ourselves only if the user actually enables it.
Attributes
Type | Description |
---|---|
Asset |
An Weaver.AssetInjectionAttribute which instantiates a copy of the target asset and assigns the copy to
the attributed member.
|