Summary
Various extension methods and utilities.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["AnimancerUtilities"]
class Type type-node
Syntax
public static class AnimancerUtilities
Fields
| Name | Constant Value | Summary |
|---|---|---|
| IsAnimancerPro | True |
Is this Animancer Pro?
static
|
Methods
| Name | Value | Summary |
|---|---|---|
| AppendDeepToString |
void |
Each element returned by `enumerator` is appended to `text`.
static
|
| AppendDescription |
StringBuilder |
Appends "Null" if `hasDescription` is null. Otherwise calls
Animancer.IHasDescription.AppendDescription(System.Text.StringBuilder,System.String).
static
|
| AppendDescription |
StringBuilder |
Appends "Null" if `maybeHasDescription` is null. Otherwise calls
Animancer.IHasDescription.AppendDescription(System.Text.StringBuilder,System.String).
static
|
| AppendField |
StringBuilder |
Appends
{prefix}{name}: {value}.static
|
| ApplyChildWeight |
void |
Applies the `child`'s current
Animancer.AnimancerNode.Weight.static
|
| AsHtmlLink |
string |
[Animancer Extension] Returns the `url` in a HTML
<a> tag.static
|
| Calculate |
void |
[Animancer Extension] [Pro-Only]
Calculates all thresholds in the `mixer` using the
Animancer.AnimancerState.AverageVelocity of each state on the X and Z axes.
Note that this method requires the Root Transform Position (XZ) -> Bake Into Pose
toggle to be disabled in the Import Settings of each UnityEngine.AnimationClip in the mixer.
static
|
| Connect |
void |
Calls
UnityEngine.Playables.PlayableGraph.Connect``2(``0,System.Int32,``1,System.Int32) using output 0
from the `child` and UnityEngine.Playables.PlayableExtensions.SetInputWeight``1(``0,System.Int32,System.Single).
static
|
| Contains |
bool |
Does the `text` contain the `character` (ignoring case)?
static
|
| ContentsAreEqual |
bool |
Are both lists the same size with the same items in the same order?
static
|
| Convert |
NativeArray |
Creates a
Unity.Collections.NativeArray`1 of UnityEngine.Animations.TransformStreamHandles
for each of the `transforms`.
static
|
| CopyExactArray |
void |
Ensures that the length and contents of `copyTo` match `copyFrom`.
static
|
| CopyParameterValue |
void |
Copies the value of the `parameter` from `copyFrom` to `copyTo`.
static
|
| CopyParameterValue |
void |
Copies the value of the `parameter` from `copyFrom` to `copyTo`.
static
|
| Create |
NativeArray |
Creates a
Unity.Collections.NativeArray`1 containing a single element
so that it can be used like a reference in Unity's C# Job system
which does not allow regular reference types.
static
|
| CreateStateAndApply |
AnimancerState |
[Animancer Extension]
Calls
Animancer.ITransition.CreateState and Animancer.ITransition.Apply(Animancer.AnimancerState).
static
|
| Create |
ArgumentException |
Returns an exception stating that the `value` is unsupported.
static
|
| DeepToString |
string |
Returns a string containing the value of each element in the `collection`
(each on a new line).
static
|
| DeepToString |
string |
Returns a string containing the value of each element in `collection`.
static
|
| DeepToString |
string |
Returns a string containing the value of each element in the `enumerator`
(each on a new line).
static
|
| DeepToString |
string |
Returns a string containing the value of each element in `enumerator`.
static
|
| FindOutput |
PlayableOutput |
Returns the output connected to the `sourcePlayable` (if any).
static
|
| FindRoot |
Transform |
[Editor-Only]
Takes a `gameObject` and returns the root
UnityEngine.Transform of the character it is part of.
static
|
| FindRoot |
Transform |
[Editor-Only]
Calls
Animancer.AnimancerUtilities.FindRoot(UnityEngine.GameObject) if the specified `obj` is a
UnityEngine.GameObject or UnityEngine.Component.
static
|
| Gather |
void |
[Animancer Extension]
Adds the `clip` to the `clips` if it wasn't there already.
static
|
| Gather |
void |
[Animancer Extension]
Calls
Animancer.AnimancerUtilities.Gather(System.Collections.Generic.ICollection{UnityEngine.AnimationClip},UnityEngine.AnimationClip) for each of the `newClips`.
static
|
| Gather |
void |
[Animancer Extension]
Calls
Animancer.AnimancerUtilities.Gather(System.Collections.Generic.ICollection{UnityEngine.AnimationClip},UnityEngine.AnimationClip) for each of the `newClips`.
static
|
| GatherFromAsset |
void |
[Animancer Extension]
Calls
Animancer.AnimancerUtilities.Gather(System.Collections.Generic.ICollection{UnityEngine.AnimationClip},UnityEngine.AnimationClip) for each clip in the `asset`.
static
|
| GatherFromSource |
void |
[Animancer Extension]
Calls
Animancer.AnimancerUtilities.Gather(System.Collections.Generic.ICollection{UnityEngine.AnimationClip},UnityEngine.AnimationClip) for each clip gathered by
UnityEngine.IAnimationClipSource.GetAnimationClips(System.Collections.Generic.List{UnityEngine.AnimationClip}).
static
|
| GatherFromSource |
void |
[Animancer Extension]
Calls
Animancer.AnimancerUtilities.GatherFromSource(System.Collections.Generic.ICollection{UnityEngine.AnimationClip},System.Object) for each item in the `source`.
static
|
| GatherFromSource |
bool |
[Animancer Extension]
Calls
Animancer.AnimancerUtilities.Gather(System.Collections.Generic.ICollection{UnityEngine.AnimationClip},UnityEngine.AnimationClip) for each clip in the `source`,
supporting both UnityEngine.IAnimationClipSource and Animancer.IAnimationClipCollection.
static
|
| Get |
TValue |
Returns the value registered in the `dictionary` using the `key`.
static
|
| GetDescription |
string |
Calls
Animancer.IHasDescription.AppendDescription(System.Text.StringBuilder,System.String) with a pooled System.Text.StringBuilder.
static
|
| GetDirection |
Vector2Int |
Attempts to interpret the `name` as a direction
based on the presence of the characters
RLUD
corresponding to Right, Left, Up, and Down.
static
|
| GetDirection |
int |
Returns
1 if the `name` contains the `positive` value
or -1 for `negative`. Otherwise returns 0.
static
|
| GetLastKey |
Object |
If a state is registered with the `key`,
this method gets it and repeats that check then returns the last state found.
static
|
| GetParameterValue |
Object |
Gets the value of the `parameter` in the `animator`.
static
|
| GetRootKey |
Object |
If the `key` is an
Animancer.AnimancerState,
this method gets its Animancer.AnimancerState.Key
and repeats that check until it finds another kind of key, which it returns.
static
|
| Get |
string |
Returns a string stating that the `value` is unsupported.
static
|
| HasEvent |
bool |
Checks if the `clip` has an animation event with the specified `functionName`.
static
|
| HasEvent |
bool |
Checks if any
UnityEngine.AnimationClip in the `source` has
an animation event with the specified `functionName`.
static
|
| Initialize |
bool |
Creates a new dictionary and returns true if it was null or calls
Animancer.AnimancerUtilities.RemoveDestroyedObjects``2(System.Collections.Generic.Dictionary{``0,``1}) and returns false if it wasn't.
static
|
| InsertAt |
void |
Resizes the `array` to be at least 1 larger
and inserts the `item` at the specified `index`.
static
|
| IsInList |
bool |
Is the `updatable` currently in a list?
static
|
| IsNullOrEmpty |
bool |
[Animancer Extension]
Is the `array`
null or its System.Array.Length 0?
static
|
| IsValid |
bool |
[Animancer Extension]
Is the `node` is not null and its
Animancer.AnimancerNodeBase.Playable valid?
static
|
| NullIsEmpty |
T[] |
Returns the `array`, or
System.Array.Empty``1 if it was null.static
|
| ReleaseToString |
string |
[Animancer Extension]
Calls
System.Text.StringBuilder.ToString and Animancer.StringBuilderPool.Release(System.Text.StringBuilder).
static
|
| RemoveAt |
void |
Removes the item at the specified `index`
and resizes the `array` to be 1 smaller.
static
|
| Remove |
void |
Removes any items from the `dictionary` that use destroyed objects as their key.
static
|
| RemovePlayable |
void |
[Pro-Only] Reconnects the input of the specified `playable` to its output.
static
|
| Set |
void |
Registers the `value` in the `dictionary` using the `key`,
replacing any previous value.
static
|
| SetChildWeight |
void |
Sets and applies the `child`'s
Animancer.AnimancerNode.Weight
and Animancer.AnimancerState.IsActive.
static
|
| SetLength |
bool |
If the `array` is
null or its System.Array.Length
isn't equal to the specified `length`, this method creates a new array
with that `length` and returns true.
Otherwise, it returns false and the array us unchanged.
static
|
| StartsWithNewLine |
bool |
Does the `text` start with a new line character?
static
|
| Swap |
void |
[Animancer Extension] Swaps
array[a] with array[b].static
|
| ToStringOrNull |
string |
If `obj` exists, this method returns
System.Object.ToString.
Or if it's null, this method returns "Null".
Or if it's an UnityEngine.Object that has been destroyed,
this method returns "Null (ObjectType)".
static
|
| TryGet |
bool |
If the `index` is within the `list`,
this method outputs the `item` at that `index` and returns true.
static
|
| Try |
bool |
Outputs the
UnityEngine.Motion.averageAngularSpeed or Animancer.IMotion.AverageAngularSpeed.static
|
| Try |
bool |
Outputs the
UnityEngine.Motion.averageSpeed or Animancer.IMotion.AverageVelocity.static
|
| TryGetFrameRate |
bool |
Attempts to get the
UnityEngine.AnimationClip.frameRate from the `clipSource` and returns true if
successful. If it has multiple animations with different rates, this method returns false.
static
|
| TryGetGameObject |
bool |
[Editor-Only]
Outputs the
UnityEngine.GameObject assignated with the `obj` and returns true if it exists.
static
|
| TryGetObject |
bool |
If the `index` is within the `list` and that `item` is not null,
this method outputs it and returns true.
static
|
| TryGetTransform |
bool |
If the `obj` is a
UnityEngine.Component or UnityEngine.GameObject,
this method outputs its `transform` and returns true.
static
|
| TryGetWrappedObject |
bool |
Returns the last
Animancer.IWrapper.WrappedObject
which is a T, including the `wrapper` itself.
static
|