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

Methods

Name Value Summary
AddContextMenuIK(GenericMenu, IHasIK) void
Adds functions relevant to the `ik`.
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.DocumentationURL.
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
AddMenuItem(GenericMenu, string, bool, GenericMenu.MenuFunction) void
Adds a menu function which is disabled if `isEnabled` is false.
static
AppendNonCriticalIssues(StringBuilder) void
Appends all issues given to Animancer.Editor.AnimancerEditorUtilities.RegisterNonCriticalIssue(System.Action{System.Text.StringBuilder}) to the `text`.
static
CalculateEditorFadeDuration(AnimancerNode, float) float
Returns the duration of the `node`s current fade (if any), otherwise returns the `defaultDuration`.
static
EditModeDelayCall(Action) void
Waits one frame to call the `method` as long as Unity is currently in Edit Mode.
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.

This method first searches all parents for an Animancer.ICharacterRoot. If it finds one, it returns the Animancer.ICharacterRoot.transform.

Otherwise, if the object is part of a prefab then it returns the root of that prefab instance.

Otherwise, it counts the number of UnityEngine.Animators in the children of the `gameObject` then does the same for each parent. If it finds a parent with a different number of child UnityEngine.Animators, it assumes that object is the parent of multiple characters and returns the previous parent as the root.
static
FindRoot(Object) Transform
Calls Animancer.Editor.AnimancerEditorUtilities.FindRoot(UnityEngine.GameObject) if the specified `obj` is a UnityEngine.GameObject or UnityEngine.Component.
static
GetComponentInHierarchy<T>(GameObject) T
Tries to find a T component on the `gameObject` or its parents or children (in that order).
static
GetIsInspectorExpanded(Object) bool
Wraps UnityEditorInternal.InternalEditorUtility.GetIsInspectorExpanded(UnityEngine.Object).
static
InitialiseCleanDictionary<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
Invoke(Object, string) Object
Tries to find a method with the specified name on the `target` object and invoke it.
static
Invoke(Type, Object, string) Object
Tries to find a method with the specified name on the `target` object and invoke it.
static
RegisterNonCriticalIssue(Action<StringBuilder>) void
Registers a delegate that can construct a description of an issue at a later time so that it doesn't waste the user's time on unimportant issues.
static
RegisterNonCriticalMissingMember(string, string) void
Calls Animancer.Editor.AnimancerEditorUtilities.RegisterNonCriticalIssue(System.Action{System.Text.StringBuilder}) with an issue indicating that a particular member was not found by reflection.
static
RegisterNonCriticalMissingType(string) void
Calls Animancer.Editor.AnimancerEditorUtilities.RegisterNonCriticalIssue(System.Action{System.Text.StringBuilder}) with an issue indicating that a particular type was not found by reflection.
static
RemoveDestroyedObjects<TKey, TValue>(Dictionary<TKey, TValue>) void
Removes any items from the `dictionary` that use destroyed objects as their key.
static
SetIsInspectorExpanded(Object, bool) void
Wraps UnityEditorInternal.InternalEditorUtility.SetIsInspectorExpanded(UnityEngine.Object,System.Boolean).
static
SetIsInspectorExpanded(Object[], bool) void
Calls Animancer.Editor.AnimancerEditorUtilities.SetIsInspectorExpanded(UnityEngine.Object,System.Boolean) on all `objects`.
static
SetLooping(AnimationClip, bool) void
Sets the UnityEngine.Motion.isLooping flag.
static
ShouldAllowReference(Object, Object) bool
Assets cannot reference scene objects.
static
TopologicalSort<T>(IEnumerable<T>, Func<T, IEnumerable<T>>, IEqualityComparer<T>, bool) List<T>
Sorts an array according to an array of dependants. If ItemA depends on ItemB, ItemA will be put later in the returned list.
static
TopologicalSort<T>(List<T>, int, Func<T, IEnumerable<T>>, IEqualityComparer<T>, bool) List<T>
Sorts an array according to an array of dependants. If ItemA depends on ItemB, ItemA will be put later in the returned list.
static
TopologicalSort<T>(List<T>, int, Func<T, IEnumerable<T>>, IEqualityComparer<T>, bool) void
Sorts an array according to an array of dependants. If ItemA depends on ItemB, ItemA will be put later in the returned list. This method assigns a new list and releases the old one to the CollectionPool.
static