DirectionalAnimations3D<TGroup> Class

Summary

A component which manages a screen-facing billboard and plays animations from a Animancer.DirectionalAnimationSet to make it look like a UnityEngine.Sprite based character is facing a particular direction in 3D space.
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • MonoBehaviour
Derived Types
graph BT Type-->Base0["MonoBehaviour"] Type["DirectionalAnimations3D<TGroup>"] class Type type-node Derived0["DirectionalAnimations3D"]-->Type click Derived0 "/animancer/api/Animancer/DirectionalAnimations3D"

Syntax

[AnimancerHelpUrl(typeof(DirectionalAnimations3D<>))]
public class DirectionalAnimations3D<TGroup> : MonoBehaviour

Remarks

Sample: Directional Character 3D

Attributes

Type Description
AnimancerHelpUrlAttribute [Assert-Conditional] A UnityEngine.HelpURLAttribute which points to Animancer's documentation.

Type Parameters

Name Description
TGroup

Fields

Name Constant Value Summary
TimeSynchronizer
Maintains the Animancer.AnimancerState.NormalizedTime when swapping between animations.

Properties

Name Value Summary
Animancer AnimancerComponent
[UnityEngine.SerializeField] The Animancer.AnimancerComponent to play animations on.
Animations DirectionalAnimationSet
[UnityEngine.SerializeField] The animations to choose between based on the Animancer.DirectionalAnimations3D`1.Forward direction.
Camera Transform
[UnityEngine.SerializeField] The UnityEngine.Camera to make the Animancer.DirectionalAnimations3D`1.Transform face towards.
Forward Vector3
[UnityEngine.SerializeField] The World-Space direction this character is facing used to select which animation to play.
Mode DirectionalAnimations3D<TGroup>.BillboardMode
[UnityEngine.SerializeField] The function used to face the Animancer.DirectionalAnimations3D`1.Transform towards the Animancer.DirectionalAnimations3D`1.Camera.
Transform Transform
[UnityEngine.SerializeField] The object to rotate according to the Animancer.DirectionalAnimations3D`1.Mode.

Methods

Name Value Summary
OnDrawGizmosSelected() void
Finds missing references, samples the current animation, and resets the scale to 1 if not using a stretched mode.
OnValidate() void
Finds missing references, samples the current animation, and resets the scale to 1 if not using a stretched mode.
PlayCurrentAnimation(TGroup) void
Plays the appropriate animation based on the current rotation and Animancer.DirectionalAnimations3D`1.Forward direction.
SetAnimations(DirectionalAnimationSet, TGroup) void
Sets the Animancer.DirectionalAnimations3D`1.Animations and plays the appropriate animation based on the current rotation and Animancer.DirectionalAnimations3D`1.Forward direction.
Update() void
Applies the Animancer.DirectionalAnimations3D`1.Mode then plays the appropriate animation based on the current rotation and Animancer.DirectionalAnimations3D`1.Forward direction.
UpdateTransform() void
Applies the Animancer.DirectionalAnimations3D`1.Mode.