public static void AssertRoot(AnimancerNode node, AnimancerPlayable root) { #if UNITY_ASSERTIONS if (node.Root != root) { throw new ArgumentException($"{nameof(AnimancerNode)}.{nameof(AnimancerNode.Root)} mismatch:" + $" cannot use a node in an {nameof(AnimancerPlayable)} that is not its {nameof(AnimancerNode.Root)}: " + node.GetDescription()); } #endif }
/************************************************************************************************************************/ /// <summary>If the `node` is fading, this methods logs a warning (Assert-Only) and cancels the fade.</summary> private static void Validate(AnimancerNode node) { if (node != null && node.FadeSpeed != 0) { #if UNITY_ASSERTIONS Debug.LogWarning($"The following {node.GetType().Name} is fading even though " + $"{nameof(DontAllowFade)} is active: {node.GetDescription()}", node.Root.Component as Object); #endif node.Weight = node.TargetWeight; } }
public static void Root(AnimancerNode node, AnimancerPlayable root) { #if UNITY_ASSERTIONS if (node == null) { throw new ArgumentNullException("node"); } if (node.Root != root) { throw new ArgumentException("AnimancerNode.Root mismatch:" + " cannot use a node in an AnimancerPlayable that is not its Root: " + node.GetDescription()); } #endif }