OptionalWarning Enum

Summary

Bitwise flags used by Animancer.Validate.IsEnabled(Animancer.OptionalWarning) 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.ProOnly.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).

You can manually disable warnings using the Settings in the Animancer.Editor.Tools.AnimancerToolsWindow (Window/Animation/Animancer Tools).

Attributes

Type Description
FlagsAttribute

Fields

Name Constant Value Summary
All -1
All warning types.
static
AnimatorDisabled 8
The Animancer.AnimancerComponent.Animator is disabled so Animancer won't be able to play animations.
static
AnimatorSpeed 131072
The UnityEngine.Animator.speed property does not affect Animancer. Use Animancer.AnimancerPlayable.Speed instead.
static
CloneComplexState 1048576
Animancer.AnimancerLayer.GetOrCreateWeightlessState(Animancer.AnimancerState) is cloning a complex state such as a Animancer.ManualMixerState or Animancer.ControllerState. This has a larger performance cost than cloning a Animancer.ClipState and these states generally have parameters that need to be controlled which may result in undesired behaviour if your scripts are only expecting to have one state to control.
static
CreateGraphDuringGuiEvent 4
An Animancer.AnimancerComponent.Playable is being initialized during a type of GUI event that shouldn't cause side effects.
static
CreateGraphWhileDisabled 2
An Animancer.AnimancerComponent.Playable is being initialized while its UnityEngine.GameObject is inactive.
static
CustomFadeBounds 32768
A Custom Fade is being started but its weight calculation does not go from 0 to 1.
static
CustomFadeNotNull 65536
A weight calculation method was not specified when attempting to start a Custom Fade.
static
DuplicateEvent 64
An Animancer Event is being added to an Animancer.AnimancerEvent.Sequence which already contains an identical event.
static
EndEventInterrupt 128
An End Event did not actually end the animation.
static
LockedEvents 512
An Animancer.AnimancerEvent.Sequence is being modified even though its Animancer.AnimancerEvent.Sequence.ShouldNotModifyReason is set.
static
MixerMinChildren 8192
A Animancer.ManualMixerState is being initialized with its Animancer.AnimancerNode.ChildCount <= 1.
static
MixerSynchronizeZeroLength 16384
A Animancer.ManualMixerState is synchronizing a child with Animancer.AnimancerState.Length = 0.
static
NativeControllerHumanoid 16
An UnityEngine.Animator.runtimeAnimatorController is assigned but the Rig is Humanoid so it can't be blended with Animancer.
static
NativeControllerHybrid 32
An UnityEngine.Animator.runtimeAnimatorController is assigned while also using a Animancer.HybridAnimancerComponent.
static
PlayableAssetAnimatorBinding 524288
Animancer.PlayableAssetState.InitializeBindings is trying to bind to the same UnityEngine.Animator that is being used by Animancer.
static
ProOnly 1
A Pro-Only Feature has been used in Animancer Lite.
static
UnsupportedEvents 1024
Animancer Events are being used on a state that does not properly support them so they might not work as intended.
static
UnsupportedIK 4096
Inverse Kinematics cannot be dynamically enabled on some States Types.
static
UnsupportedSpeed 2048
Animancer.AnimancerNode.Speed is being used on a state that doesn't support it.
static
UnusedNode 262144
An Animancer.AnimancerNode.Root is null during finalization (garbage collection).
static
UselessEvent 256
An Animancer.AnimancerEvent that does nothing was invoked. Most likely it was not configured correctly.
static

Extension Methods

Name Value Summary
Disable() void
[Animancer Extension] [Assert-Conditional] Disables the specified warning type. Supports bitwise combinations.
DisableTemporarily() OptionalWarning
[Animancer Extension] [Assert-Only] Disables the specified warnings and returns those that were previously enabled.
Enable() void
[Animancer Extension] [Assert-Conditional] Enables the specified warning type. Supports bitwise combinations.
IsDisabled() bool
[Animancer Extension] [Assert-Only] Are all of the specified warning types disabled?
IsEnabled() bool
[Animancer Extension] [Assert-Only] Are none of the specified warning types disabled?
Log(string, Object) void
[Animancer Extension] [Assert-Conditional] Logs the `message` as a warning if the `type` is enabled.
SetEnabled(bool) void
[Animancer Extension] [Assert-Conditional] Enables or disables the specified warning type. Supports bitwise combinations.