public void OnPresentationSet(UnitVisualPresentation presentation) { Presentation = presentation; Presentation.Animator.enabled = true; // reset graph ofc when getting a new presentation DestroyPlayableGraph(); CreatePlayableGraph($"{Backend.DstEntity}"); CreatePlayable(presentation.Animator); SetAnimatorOutput("standard output", presentation.Animator); m_PlayableGraph.SetTimeUpdateMode(DirectorUpdateMode.GameTime); CurrAnimation = new TargetAnimation(null); m_PlayableGraph.Stop(); m_PlayableGraph.Play(); }
public virtual void numTotalFrames_ValueChanged(object sender, EventArgs e) { if (TargetAnimation == null || _updating) { return; } int max = (int)PlaybackPanel.numTotalFrames.Value; PlaybackPanel.numFrameIndex.Maximum = max; if (Interpolated.Contains(TargetAnimation.GetType()) && TargetAnimation.Loop) { max--; } _maxFrame = max; TargetAnimation.FrameCount = max; }
public void SetMenu(Type type) { CurrentAnimation = new TargetAnimation(type, previousType: CurrentMenu); Debug.Log($"SetMenu, curr={type}, prev={CurrentAnimation.PreviousType}"); if (PreviousMenu != null && PreviousMenu.HasInterface(typeof(IMenuCallbacks)) && PreviousMenu.IsSubclassOf(typeof(ComponentSystemBase))) { var system = (IMenuCallbacks)World.GetExistingSystem(PreviousMenu); system.OnMenuUnset(CurrentAnimation); } if (type != null && type.HasInterface(typeof(IMenuCallbacks)) && type.IsSubclassOf(typeof(ComponentSystemBase))) { var system = (IMenuCallbacks)World.GetExistingSystem(type); system.OnMenuSet(CurrentAnimation); } OnMenuUpdate?.Invoke(CurrentAnimation); }
public void SetTargetAnimationWithTypeKeepTransition(Type type) { CurrAnimation = new TargetAnimation(type, transitionStart: CurrAnimation.TransitionStart, transitionEnd: CurrAnimation.TransitionEnd, previousType: CurrAnimation.Type); }
public void SetTargetAnimation(TargetAnimation target) { CurrAnimation = target; }
public void SetManual(TargetAnimation target) { CurrentAnimation = target; OnMenuUpdate?.Invoke(CurrentAnimation); }