OptionalWarning Enum

Summary

Bitwise flags used by Validate.IsEnabled and Animancer.Validate.Disable(Animancer.OptionalWarning) to determine which warnings Animancer should give.

These warnings are all optional. Feel free to disable any of them if you understand the potential issues they are referring to.
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • Enum
graph BT Type-->Base0["Enum"] Type["OptionalWarning"] class Type type-node

Syntax

[Flags]
public enum OptionalWarning

Examples

You can put the following method in any class to disable whatever warnings you don't want on startup:
#if UNITY_ASSERTIONS
[UnityEngine.RuntimeInitializeOnLoadMethod(UnityEngine.RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void DisableAnimancerWarnings()
{
    Animancer.OptionalWarning.EndEventInterrupt.Disable();
    
    // You could disable OptionalWarning.All, but that is not recommended for obvious reasons.
}
#endif

Remarks

All warnings are enabled by default, but are compiled out of runtime builds (except development builds).

Attributes

Type Description
FlagsAttribute

Fields

Name Constant Value Summary
All -1
All warning types.
static
AnimatorSpeed 2048
The UnityEngine.Animator.speed property does not affect Animancer. Use Animancer.AnimancerPlayable.Speed instead.
static
CreateGraphDuringGuiEvent 4
An Animancer.AnimancerComponent.Playable is being initialised during a type of GUI event that shouldn't cause side effects.
static
CreateGraphWhileDisabled 2
An Animancer.AnimancerComponent.Playable is being initialised while its UnityEngine.GameObject is inactive.
static
CustomFadeBounds 512
A Custom Fade is being started but its weight calculation does not go from 0 to 1.
static
CustomFadeNotNull 1024
A weight calculation method was not specified when attempting to start a Custom Fade.
static
DuplicateEvent 8
An Animancer Event is being added to an Animancer.AnimancerEvent.Sequence which already contains an identical event.
static
EndEventInterrupt 16
An End Event did not actually end the animation.
static
MixerMinChildren 128
A Animancer.MixerState is being initialised with its Animancer.AnimancerNode.ChildCount <= 1.
static
MixerSynchroniseZeroLength 256
A Animancer.MixerState is synchronising a child with Animancer.AnimancerState.Length = 0.
static
ProOnly 1
A Pro-Only Feature has been used in Animancer Lite.
static
UnsupportedEvents 32
Animancer Events are being used on a state that does not properly support them so they might not work as intended.
static
UnsupportedIK 64
Inverse Kinematics cannot be dynamically enabled on some States Types.
static
UnusedNode 4096
An Animancer.AnimancerNode.Root is null during finalization (garbage collection).
static

Extension Methods

Name Value Summary
Disable() void
[Assert-Conditional] Disables the specified warning type. Supports bitwise combinations.
Enable() void
[Assert-Conditional] Re-enables the specified warning type. Supports bitwise combinations.
Log(string, Object) void
[Assert-Conditional] Logs the `message` as a warning if the `type` is enabled.
SetEnabled(bool) void
[Assert-Conditional] Enables or disables the specified warning type. Supports bitwise combinations.