Weaver Namespace

Summary

The core of the Weaver plugin.

Class Types

Class Summary
AnimationReferenceAttribute Marks a string or int field to show a popup menu in the inspector which lets you select an animation value name or hash respectively. Values include both states and parameters.

WARNING: selecting a value using this attribute does not link the field to that state or parameter. Renaming the state or parameter will NOT automatically update the value of the attributed field.

If you're interested in an animation system which avoids the need for these weak unsafe references entirely, you should check out Animancer.
Asset<T> A wrapper which simplifies the process of lazy loading and caching resources and other assets, i.e. only loading them when they are first needed instead of on startup.
AssetInjectionAttribute An Weaver.InjectionAttribute for attributes that inject an asset reference.
AssetInstanceAttribute An Weaver.AssetInjectionAttribute which instantiates a copy of the target asset and assigns the copy to the attributed member.
AssetList A UnityEngine.ScriptableObject containing a list automatically populated with all assets of a given type in a specific folder. Gathering takes place in the Unity Editor so the list can be loaded efficiently at runtime.
AssetList<T> An Weaver.AssetList that serializes direct references to the target assets.
AssetListBase A UnityEngine.ScriptableObject containing a list which is automatically populated with all assets of a given type in a specific folder. Gathering takes place in the Unity Editor so the list can be loaded efficiently at runtime and the target assets do not need to be in a Resources folder.
AssetPoolAttribute An Weaver.AssetInjectionAttribute which assigns an Weaver.ObjectPool`1 to the attributed member that creates new items by instantiating copies of the target asset.
AssetReferenceAttribute An Weaver.AssetInjectionAttribute which assigns the target asset directly to the attributed member.
CSharp A variety of methods relating to C# code.
EditorPrefAttribute An Weaver.InjectionAttribute which saves and loads the value of the attributed member in UnityEditor.EditorPrefs.
InjectionAttribute Base class for attributes which define behaviours for automatically injecting values into static properties.
ItemList A Weaver.MetaAssetList`2 of Weaver.Examples.Item prefabs and their Weaver.Examples.ItemMetaData.
LazyAssetList<T> An Weaver.AssetList that serializes resource paths so that assets don't need to be loaded until they are first accessed.
MeshBuilder Encapsulates lists of vertices, normals, etc. to simplify the procedural generation of meshes.

To use: simply add elements to the lists (Weaver.MeshBuilder.Vertices, Weaver.MeshBuilder.Indices, Weaver.MeshBuilder.UVs, etc.) then call any of the Compile() overloads. You can also implicitly cast a Weaver.MeshBuilder to a UnityEngine.Mesh.

You can efficiently reuse a Weaver.MeshBuilder by calling Weaver.MeshBuilder.Clear.
MeshUtilities Various utility methods for using the Weaver.MeshBuilder class.
MetaAssetList<TAsset, TMeta> A Weaver.LazyAssetList`1 that serializes a specific type of meta-data about the listed assets so that the data can be accessed and evaluated without actually loading the assets.
MissileList An Weaver.AssetList`1 of Weaver.Examples.Missile prefabs.
ObjectList An Weaver.AssetList for any UnityEngine.Object.
ObjectPool Various utilities and extension methods for Weaver.ObjectPool`1.

More detailed instructons on how to use this class and those related to it can be found at https://kybernetik.com.au/weaver/docs/misc/object-pooling.
ObjectPool<T> A collection of objects that can create new items as necessary. Get an object from the pool with Weaver.ObjectPool`1.Acquire. Return it to the pool with Weaver.ObjectPool`1.Release(`0).

The non-generic Weaver.ObjectPool class contains some useful methods of creating commonly used pools.

More detailed instructons on how to use this class and those related to it can be found at https://kybernetik.com.au/weaver/docs/misc/object-pooling.
OnInjectionCompleteAttribute An System.Attribute for static parameterless methods to have Weaver invoke them once the static dependency injection is complete.
PoolableBehaviour<T> A UnityEngine.MonoBehaviour component which automatically detects the Weaver.ObjectPool`1 that created it so it can be released back to that pool (or simply destroyed if it wasn't created by a pool) using the Weaver.ObjectPool.TryReleaseOrDestroyGameObject``1(``0) extension method.

When inheriting from this class, T should always be the child class itself, I.E. class ChildClass : PoolableBehaviour<ChildClass>

More detailed instructons on how to use this class and those related to it can be found in the documentation.
PooledList Various utilities and extension methods for Weaver.PooledList`1.

More detailed instructons on how to use this class and those related to it can be found at https://kybernetik.com.au/weaver/docs/misc/object-pooling.
PooledList<T> A System.Collections.Generic.List`1 of active objects backed by an Weaver.ObjectPool`1 of inactive objects ready to be reused.

More detailed instructons on how to use this class and those related to it can be found at https://kybernetik.com.au/weaver/docs/misc/object-pooling.
PrefAttribute An Weaver.InjectionAttribute which saves and loads the value of the attributed member in UnityEngine.PlayerPrefs.
ProceduralAssetAttribute When placed alongside any kind of Weaver.AssetInjectionAttribute, this attribute allows the injected asset to be procedurally generated.
ReflectionUtilities A variety of utility methods relating to reflection.
Substring Encapsulates a string to treat it as a variable substring without the memory allocation and garbage collection costs of System.String.Substring(System.Int32,System.Int32).
WeaverUtilities A variety of miscellaneous utility methods.

Interface Types

Interface Summary
IAssetList<T> A strongly typed asset list.
IDependant<T> Indicates that a type can depend on other objects. Used for topological sorting.
IMetaDataProvider<T> An object that can specify its own meta-data.
IOnCreate Exposes a method to be called when a new instance is created by Weaver.WeaverUtilities.EnsureExists``1(``0@).
IPoolable An object with a callback method for when it is released to an Weaver.ObjectPool`1.
IReferenceIndex An object that references a particular index in another list.

Enum Types

Enum Summary
OptionalBool A trinary logic value: true, false, or unspecified.

Namespaces

Namespace Summary
Weaver.Editor Editor-Only scripts.
Weaver.Examples Examples of how to use Weaver.