AnimancerEditorUtilities Class

Summary

[Editor-Only] Various utilities used throughout Animancer.
Assembly
Animancer.dll
Namespace
Animancer.Editor
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["AnimancerEditorUtilities"] class Type type-node

Syntax

public static class AnimancerEditorUtilities

Fields

Name Constant Value Summary
AnyAccessBindings 60
Commonly used System.Reflection.BindingFlags combinations.
static
InstanceBindings 52
Commonly used System.Reflection.BindingFlags combinations.
static
StaticBindings 56
Commonly used System.Reflection.BindingFlags combinations.
static

Properties

Name Value Summary
IsChangingPlayMode bool
Is the Unity Editor is currently changing between Play Mode and Edit Mode?
static
PlayModeState PlayModeStateChange
The most recent UnityEditor.PlayModeStateChange.
static

Methods

Name Value Summary
AddContextMenuIK(GenericMenu, IPlayableWrapper) void
Adds functions to show and set Animancer.IPlayableWrapper.ApplyAnimatorIK and Animancer.IPlayableWrapper.ApplyFootIK.
static
AddDocumentationLink(GenericMenu, string, string) void
Adds a menu function to open a web page. If the `linkSuffix` starts with a '/' then it will be relative to the Animancer.Strings.DocsURLs.Documentation.
static
AddFadeFunction(GenericMenu, string, bool, AnimancerNode, Action<float>) void
Adds a menu function which passes the result of Animancer.Editor.AnimancerEditorUtilities.CalculateEditorFadeDuration(Animancer.AnimancerNode,System.Single) into `startFade`.
static
AppendNameAndGenericArguments(StringBuilder, Type, bool, int) int
Appends the generic arguments of `type` (after skipping the specified number).
static
CalculateEditorFadeDuration(AnimancerNode, float) float
[Animancer Extension] [Editor-Only] Returns the duration of the `node`s current fade (if any), otherwise returns the `defaultDuration`.
static
FindAssetOfType<T>() T
Finds an asset of the specified type anywhere in the project.
static
FindRoot(GameObject) Transform
Takes a `gameObject` and returns the root UnityEngine.Transform of the character it is part of.
static
FindRoot(Object) Transform
Calls Animancer.Editor.AnimancerEditorUtilities.FindRoot(UnityEngine.GameObject) if the specified `obj` is a UnityEngine.GameObject or UnityEngine.Component.
static
GetAttribute<TAttribute>(ICustomAttributeProvider, bool) TAttribute
[Animancer Extension] [Editor-Only] Returns the first TAttribute attribute on the `member` or null if there is none.
static
GetNameCS(Type, bool) string
Returns the name of a `type` as it would appear in C# code.
static
InitializeCleanDictionary<TKey, TValue>(Dictionary<TKey, TValue>) bool
Creates a new dictionary and returns true if it was null or calls Animancer.Editor.AnimancerEditorUtilities.RemoveDestroyedObjects``2(System.Collections.Generic.Dictionary{``0,``1}) and returns false if it wasn't.
static
IsNaN(Vector2) bool
[Animancer Extension] [Editor-Only] Is the UnityEngine.Vector2.x or UnityEngine.Vector2.y NaN?
static
IsNaN(Vector3) bool
[Animancer Extension] [Editor-Only] Is the UnityEngine.Vector3.x, UnityEngine.Vector3.y, or UnityEngine.Vector3.z NaN?
static
NormalizeChildWeights(IPlayableWrapper) void
Re-scales the Animancer.AnimancerNode.Weight of all children to add up to 1.
static
RemoveDestroyedObjects<TKey, TValue>(Dictionary<TKey, TValue>) void
Removes any items from the `dictionary` that use destroyed objects as their key.
static
RemoveMissingAndDuplicates(List<GameObject>) bool
Removes any items from the `list` that are null and items that appear multiple times. Returns true if the `list` was modified.
static
SetCount<T>(List<T>, int) void
Adds default items or removes items to make the System.Collections.Generic.List`1.Count equal to the `count`.
static
SetLooping(AnimationClip, bool) void
Sets the UnityEngine.Motion.isLooping flag.
static
ToStringCached(float) string
[Animancer Extension] Calls System.Single.ToString(System.String) using "g" as the format and caches the result.
static
TryGetGameObject(Object, GameObject) bool
Outputs the UnityEngine.GameObject assignated with the `obj` and returns true if it exists.
static