// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2023 Kybernetik // using UnityEngine.Animations; namespace Animancer { /// [Pro-Only] /// A base class that allows Animation Jobs to be easily inserted into an Animancer graph. /// /// /// Documentation: Animated Properties /// /// Animation Jobs /// https://kybernetik.com.au/animancer/api/Animancer/AnimancerJob_1 /// public abstract class AnimancerJob where T : struct, IAnimationJob { /************************************************************************************************************************/ /// The . protected T _Job; /// The running the job. protected AnimationScriptPlayable _Playable; /************************************************************************************************************************/ /// Creates the and inserts it between the root and the graph output. protected void CreatePlayable(AnimancerPlayable animancer) { _Playable = animancer.InsertOutputJob(_Job); } /************************************************************************************************************************/ /// /// Destroys the and restores the graph connection it was intercepting. /// /// /// This method is NOT called automatically, so if you need to guarantee that things will get cleaned up you /// should use . /// public virtual void Destroy() { AnimancerUtilities.RemovePlayable(_Playable); } /************************************************************************************************************************/ } }