Summary
An
Weaver.AssetInjectionAttribute which instantiates a copy of the target asset and assigns the copy to
the attributed member.
- Assembly
- Weaver
.dll - Namespace
- Weaver
- Interfaces
-
- IInjector
- IHasCustomMenu
- WeaverWindow
.IItem
- Base Types
-
- Attribute
- InjectionAttribute
- Asset
Injection Attribute
graph BT
Type-->Base0["AssetInjectionAttribute"]
click Base0 "/weaver/api/Weaver/AssetInjectionAttribute"
Base0-->Base1["InjectionAttribute"]
click Base1 "/weaver/api/Weaver/InjectionAttribute"
Base1-->Base2["Attribute"]
Type-.->Interface0["IInjector"]
Type-.->Interface1["IHasCustomMenu"]
Type-.->Interface2["WeaverWindow.IItem"]
Type["AssetInstanceAttribute"]
class Type type-node
Syntax
public sealed class AssetInstanceAttribute : AssetInjectionAttribute, IInjector, IHasCustomMenu,
WeaverWindow.IItem
Fields
| Name | Constant Value | Summary |
|---|---|---|
| _InspectorTooltip |
[Editor-Only]
The cached tooltip of this attribute. Should only be read by
Weaver.InjectionAttribute.GetInspectorTooltip.
Inherited from InjectionAttribute
|
|
| _ToString |
[Editor-Only] Cached return value of
Weaver.InjectionAttribute.ToString.Inherited from InjectionAttribute
|
Properties
| Name | Value | Summary |
|---|---|---|
| AllAssetInjectors | List |
[Editor-Only]
A subset of
Weaver.Editor.InjectorManager.AllInjectionAttributes containing only asset injectors.
Inherited from Asset
static
|
| AssetType | Type |
[Editor-Only]
The type of asset which will be injected into the attributed
Weaver.InjectionAttribute.Member.
Inherited from Asset
|
| DisableAutoFind | bool |
If true, this attribute will not search for a target asset by name when it is first applied.
Inherited from Asset
|
| DontAssign | bool |
If set to true: when the instance is created it will not be assigned to the attributed member.
This is useful if the instance doesn't need a static access point or if it will assign one itself.
|
| EditorOnly | bool |
If set to true, this attribute won't be used in builds. Must be set for attributes inside
#if UNITY_EDITOR regions since that fact can't be detected automatically.
Inherited from InjectionAttribute
|
| FileName | string |
If set, this value will be used as the ideal file name when searching for the target asset.
Inherited from Asset
|
| InEditMode | bool |
[Editor-Only]
Returns false. Asset instances should not be created automatically in Edit Mode.
|
| Optional | bool |
If set to true, this attribute will not give any errors when it is unable to initialize with an appropriate value.
Inherited from InjectionAttribute
|
| ShouldShow | bool |
[Editor-Only]
Indicates whether this attribute should currently be visible in the
Weaver.Editor.Window.WeaverWindow.
Inherited from Asset
|
| StartInactive | bool |
If set to true: the instance will be created with its
UnityEngine.GameObject.activeSelf set to false.
Only works for UnityEngine.GameObjects and UnityEngine.Components.
|
| Tooltip | string |
A description of the purpose of the attributed property to be shown in the Unity Editor.
Inherited from InjectionAttribute
|
Methods
| Name | Value | Summary |
|---|---|---|
| AddItemsToMenu |
void |
[Editor-Only]
Adds various functions for this attribute to the `menu`.
Inherited from Asset
|
| AppendDetail |
void |
[Editor-Only]
Appends an opening bracket or comma depending on `isFirst` followed by the specified `detail` and sets
`isFirst` to false. Intended for use within
Weaver.InjectionAttribute.AppendDetails(System.Text.StringBuilder,System.Boolean@).
Inherited from InjectionAttribute
|
| AppendDetails |
void |
[Editor-Only]
Appends any optional properties that have been set on this attribute.
|
| CheckContextMenu |
void |
[Editor-Only]
Calls
Weaver.InjectionAttribute.CheckContextMenu(UnityEngine.Rect) with the last UnityEngine.GUILayout rect.
Inherited from InjectionAttribute
|
| CheckContextMenu |
void |
[Editor-Only]
If the current event is a
UnityEngine.EventType.ContextClick inside the `area`, this method builds a menu
using Weaver.InjectionAttribute.AddItemsToMenu(UnityEditor.GenericMenu) and shows it.
Inherited from InjectionAttribute
|
| DoAssetField |
void |
[Editor-Only]
Draws an inspector field for the
Weaver.AssetInjectionAttribute.Asset.
Inherited from Asset
|
| DoCreateButton |
void |
[Editor-Only]
Draws a button to attempt to create a default asset of the
Weaver.AssetInjectionAttribute.AssetType in the procedural asset
output directory.
Inherited from Asset
|
| DoFindButton |
void |
[Editor-Only]
Draws a button to attempt to find the target asset using an
Weaver.Editor.AssetPathMatcher.
Inherited from Asset
|
| DoInspectorGUI |
void |
[Editor-Only] Draws the inspector GUI for this attribute.
Inherited from Asset
|
| Equals |
bool |
[Editor-Only] Uses
System.Object.ReferenceEquals(System.Object,System.Object) instead of the default System.Attribute.Equals(System.Object).Inherited from InjectionAttribute
|
| Get |
Asset |
[Editor-Only]
Returns the
Weaver.AssetInjectionAttribute on the specified `member` (if any).
Inherited from Asset
static
|
| GetHashCode |
int |
[Editor-Only] Returns the hash code for this instance.
Inherited from InjectionAttribute
|
| GetInspectorTooltip |
string |
[Editor-Only]
Builds, caches, and returns a tooltip message for this attribute.
Inherited from Asset
|
| Get |
string |
[Editor-Only]
Returns a message indicating that no value has been assigned for this attribute.
Inherited from Asset
|
| GetSourceAsset |
Object |
[Editor-Only]
Returns the original asset that was used to inject the specified `value` (if any).
Inherited from Asset
static
|
| GetTempLabelContent |
GUIContent |
[Editor-Only]
Returns a reusable
UnityEngine.GUIContent containing the name, tooltip, and icon of this attribute.
Inherited from InjectionAttribute
|
| GetValue |
Object |
[Editor-Only]
Tries to get the value of the attributed member. Catches and logs any exceptions.
Inherited from InjectionAttribute
|
| GetValueToInject |
Object |
[Editor-Only]
Returns a value to be assigned to the attributed property.
|
| Log |
bool |
[Editor-Only]
Logs a message indicating that this attribute is invalid, followed by a `message` explaining why.
Returns false.
Inherited from InjectionAttribute
|
| ManuallyAssignAsset |
void |
[Editor-Only]
Tries to set the
Weaver.AssetInjectionAttribute.Asset and records an UnityEditor.Undo state for it.
Inherited from Asset
|
| SetValue |
void |
[Editor-Only]
Tries to set the value of the attributed member. Catches and logs any exceptions.
|
| ToString |
string |
[Editor-Only] Returns a description of this attribute.
Inherited from InjectionAttribute
|
| TryInitialize |
bool |
[Editor-Only]
Attempts to initialize this attribute and returns true if successful.
Specifically, this method ensures that the
Weaver.InjectionAttribute.MemberType inherits from
UnityEngine.Object.
Inherited from Asset
|
| TryInitialize |
bool |
[Editor-Only]
Attempts to initialize this attribute and returns true if successful.
Specifically, this method ensures that the
Weaver.InjectionAttribute.MemberType inherits from
UnityEngine.Object.
Inherited from Asset
|
| ValidateAsset |
bool |
[Editor-Only]
Indicates whether the specified `asset` can be injected into the attributed
Weaver.InjectionAttribute.Member by this attribute.
Inherited from Asset
|
Operators
| Name | Value | Summary |
|---|---|---|
| operator != |
bool |
Inherited from InjectionAttribute
|
| operator == |
bool |
Inherited from InjectionAttribute
|