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 |
---|---|---|
Add |
T |
[Animancer Extension]
Adds the specified type of
Animancer.IAnimancerComponent , links it to the `animator`, and returns it.
static
|
Assert |
void |
[Assert-Conditional]
Throws an
UnityEngine.Assertions.AssertionException if the `condition` is false.
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
|
Clone |
T |
Creates a new T and calls
Animancer.ICopyable`1.CopyFrom(`0) on it.static
|
Convert |
NativeArray |
Creates a
Unity.Collections.NativeArray`1 of UnityEngine.Animations.TransformStreamHandle s 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
|
EditModePlay |
void |
[Editor-Conditional] Plays the specified `clip` if called in Edit Mode.
static
|
Edit |
void |
[Editor-Conditional]
Applies the effects of the animation `clip` to the
UnityEngine.Component.gameObject .
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 |
T |
Returns the first T component on the `gameObject` or its parents or children (in
that order).
static
|
Get |
bool |
If the `component` is
null , this method tries to find one on the `gameObject` or its parents or
children (in that order).
static
|
Get |
T |
[Animancer Extension]
Returns the
Animancer.IAnimancerComponent on the same UnityEngine.GameObject as the `animator` if
there is one. Otherwise this method adds a new one and returns it.
static
|
GetParameterValue |
Object |
Gets the value of the `parameter` in the `animator`.
static
|
GetParameterValue |
Object |
Gets the value of the `parameter` in the `playable`.
static
|
Get |
string |
Returns a string stating that the `value` is unsupported.
static
|
GetWrappedObject |
Object |
Returns the
Animancer.IWrapper.WrappedObject recursively.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
|
IsFinite |
bool |
[Animancer Extension] Is the `value` not NaN or Infinity?
static
|
IsFinite |
bool |
[Animancer Extension] Is the `value` not NaN or Infinity?
static
|
IsFinite |
bool |
[Animancer Extension] Are all components of the `value` not NaN or Infinity?
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
Animancer.AnimancerNode.IsValid ?static
|
IsValid |
bool |
Returns the
Animancer.ITransitionDetailed.IsValid with support for Animancer.IWrapper .static
|
IsValid |
bool |
[Animancer Extension] Is the `transition` not null and
Animancer.ITransitionDetailed.IsValid ?static
|
RemovePlayable |
void |
[Pro-Only] Reconnects the input of the specified `playable` to its output.
static
|
Round |
float |
Rounds the `value` to the nearest integer using
System.MidpointRounding.AwayFromZero .
static
|
Round |
float |
Rounds the `value` to be a multiple of the `multiple` using
System.MidpointRounding.AwayFromZero .
static
|
SetDirty |
void |
[Editor-Conditional] Indicates that the `target` needs to be re-serialized.
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 .
static
|
SetParameterValue |
void |
Sets the `value` of the `parameter` in the `animator`.
static
|
SetParameterValue |
void |
Sets the `value` of the `parameter` in the `playable`.
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 is null , this method returns "Null" .
Or if it is an UnityEngine.Object that has been destroyed, this method returns "Null (ObjectType)" .
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
|
Try |
bool |
[Assert-Only]
Uses reflection to achieve the same as
System.Delegate.GetInvocationList without allocating
garbage every time.
static
|
TryGetIsLooping |
bool |
Outputs the
UnityEngine.Motion.isLooping or Animancer.ITransitionDetailed.IsLooping .static
|
TryGetLength |
bool |
Outputs the
UnityEngine.AnimationClip.length or Animancer.ITransitionDetailed.MaximumDuration .static
|
TryGetWrappedObject |
bool |
Returns the `wrapper` or first
Animancer.IWrapper.WrappedObject which is a T.
static
|
Wrap |
float |
Loops the `value` so that
0 <= value < length .static
|
Wrap01 |
float |
Loops the `value` so that
0 <= value < 1 .static
|