/// <summary> /// Animation extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static TriggerAnimation TriggerAnimation(this TransitionStep transitionStep, float speed = 1, float delay = 0, float duration = 0.5f, string trigger = "TransitionIn", string targetState = "TransitionOut", bool runAtStart = false, Action onStart = null, Action <float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new TriggerAnimation(transitionStep.Target, speed, delay, duration, trigger, targetState, onStart, onUpdate, onComplete); if (runAtStart) { transitionStep.AddOnStartTransitionStep(newTransitionStep); } else { transitionStep.AddOnCompleteTransitionStep(newTransitionStep); } newTransitionStep.Parent = transitionStep; return(newTransitionStep); }
/// <summary> /// Animation extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static TriggerAnimation TriggerAnimation(this TransitionStep transitionStep, float speed = 1, float delay = 0, float duration = 0.5f, string trigger = "TransitionIn", string targetState = "TransitionOut", bool runAtStart = false, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new TriggerAnimation(transitionStep.Target, speed, delay, duration, trigger, targetState, onStart, onUpdate, onComplete); if (runAtStart) transitionStep.AddOnStartTransitionStep(newTransitionStep); else transitionStep.AddOnCompleteTransitionStep(newTransitionStep); newTransitionStep.Parent = transitionStep; return newTransitionStep; }