Beispiel #1
0
        /// <summary>
        /// Chain a new custom transition step with the specfied settings onto the current one.
        /// </summary>
        /// <returns></returns>
        public TransitionStep ChainCustomTransitionStep(float delay    = 0,
                                                        float duration = 0.5f,
                                                        TransitionStep.TransitionModeType transitionMode     = TransitionStep.TransitionModeType.Specified,
                                                        TransitionStep.TimeUpdateMethodType timeUpdateMethod = TransitionStep.TimeUpdateMethodType.GameTime,
                                                        TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                                        AnimationCurve animationCurve        = null,
                                                        bool runAtStart = false,
                                                        Action <TransitionStep> onStart    = null,
                                                        Action <TransitionStep> onUpdate   = null,
                                                        Action <TransitionStep> onComplete = null)
        {
            var newTransitionStep = new TransitionStep(Target,
                                                       delay,
                                                       duration,
                                                       transitionMode,
                                                       timeUpdateMethod,
                                                       tweenType,
                                                       animationCurve,
                                                       onStart: onStart,
                                                       onUpdate: onUpdate,
                                                       onComplete: onComplete);

            newTransitionStep.AddToChain(this, runAtStart);
            return(newTransitionStep);
        }
Beispiel #2
0
 /// <summary>
 /// Add a TransitionStep that should be invoked in OnComplete.
 /// </summary>
 /// <param name="transitionStep"></param>
 /// <returns></returns>
 public TransitionStep AddOnCompleteTransitionStep(TransitionStep transitionStep)
 {
     if (transitionStep != null)
     {
         OnComplete += transitionStep.Start;
     }
     return(this);
 }
Beispiel #3
0
 /// <summary>
 /// Add this TransitionStep into a chain
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="runAtStart"></param>
 public void AddToChain(TransitionStep parent, bool runAtStart)
 {
     if (runAtStart)
     {
         parent.AddOnStartTransitionStep(this);
     }
     else
     {
         parent.AddOnCompleteTransitionStep(this);
     }
     Parent = parent;
 }
Beispiel #4
0
 /// <summary>
 /// Call to start the transition - for use from callbacks.
 /// </summary>
 public virtual void Start(TransitionStep transitionStep)
 {
     Start();
 }