Validate Class

Summary

Enforces various rules throughout the system, most of which are compiled out if UNITY_ASSERTIONS is not defined (by default, it is only defined in the Unity Editor and in Development Builds).
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["Validate"] class Type type-node

Syntax

public static class Validate

Fields

Name Constant Value Summary
ExpectedWarnings
[Internal] [Assert-Only] Warnings that are expected to be logged. If triggered, they will instead be removed from this set.
static

Properties

Name Value Summary
PermanentlyDisabledWarnings OptionalWarning
[Assert-Only] Warnings that are automatically disabled
static
WarningsAsErrors int
[Internal] [Assert-Only] If positive, unexpected warnings will throw exceptions instead of being logged.
static

Methods

Name Value Summary
AssertAnimationClip(AnimationClip, bool, string) void
[Assert-Conditional] Throws if the `clip` is null, not an asset, or marked as UnityEngine.AnimationClip.legacy.
static
AssertCanRemoveChild(AnimancerState, IList<AnimancerState>, int) void
[Assert-Conditional] Throws if the `state` was not actually assigned to its specified Animancer.AnimancerNode.Index in the `states`.
static
AssertExpectedWarningsReceived() void
[Internal] [Assert-Only] Asserts that all Animancer.Validate.ExpectedWarnings have been triggered.
static
AssertGraph(AnimancerNode, AnimancerGraph) void
[Assert-Conditional] Throws if the Animancer.AnimancerNodeBase.Graph is not the `graph`.
static
AssertPlayable(AnimancerNode) void
[Assert-Conditional] Throws if the `node`'s UnityEngine.Playables.Playable is invalid.
static
AssertSetWeight(AnimancerNode, float) void
[Assert-Conditional] Throws if the `weight` is negative, infinity, or NaN.
static
Disable(OptionalWarning) void
[Animancer Extension] [Assert-Conditional] Disables the specified warning type. Supports bitwise combinations.
static
DisableTemporarily(OptionalWarning) OptionalWarning
[Animancer Extension] [Assert-Only] Disables the specified warnings and returns those that were previously enabled.
static
Enable(OptionalWarning) void
[Animancer Extension] [Assert-Conditional] Enables the specified warning type. Supports bitwise combinations.
static
IsDisabled(OptionalWarning) bool
[Animancer Extension] [Assert-Only] Are all of the specified warning types disabled?
static
IsEnabled(OptionalWarning) bool
[Animancer Extension] [Assert-Only] Are none of the specified warning types disabled?
static
Log(OptionalWarning, string, Object) void
[Animancer Extension] [Assert-Conditional] Logs the `message` as a warning if the `type` is enabled.
static
SetEnabled(OptionalWarning, bool) void
[Animancer Extension] [Assert-Conditional] Enables or disables the specified warning type. Supports bitwise combinations.
static
ValueRule(float, Validate.Value) void
Enforces the `rule` on the `value`.
static