Example #1
0
        /// <summary>
        /// Move extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static Move MoveFromCurrent(this TransitionStep transitionStep,
                                           Vector3 endPosition,
                                           float delay    = 0,
                                           float duration = 0.5f,
                                           TransitionStep.TimeUpdateMethodType timeUpdateMethod = TransitionStep.TimeUpdateMethodType.GameTime,
                                           TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                           AnimationCurve animationCurve        = null,
                                           TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global,
                                           bool runAtStart = false,
                                           Action <TransitionStep> onStart    = null,
                                           Action <TransitionStep> onUpdate   = null,
                                           Action <TransitionStep> onComplete = null)
        {
            var newTransitionStep = transitionStep.Move(Vector3.zero,
                                                        endPosition,
                                                        delay,
                                                        duration,
                                                        TransitionStep.TransitionModeType.FromCurrent,
                                                        timeUpdateMethod,
                                                        tweenType,
                                                        animationCurve,
                                                        coordinateMode,
                                                        runAtStart,
                                                        onStart,
                                                        onUpdate,
                                                        onComplete);

            return(newTransitionStep);
        }
Example #2
0
        /// <summary>
        /// Move extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static Move Move(this TransitionStep transitionStep,
                                Vector3 startPosition,
                                Vector3 endPosition,
                                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,
                                TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global,
                                bool runAtStart = false,
                                Action <TransitionStep> onStart    = null,
                                Action <TransitionStep> onUpdate   = null,
                                Action <TransitionStep> onComplete = null)
        {
            var newTransitionStep = new Move(transitionStep.Target,
                                             startPosition,
                                             endPosition,
                                             delay,
                                             duration,
                                             transitionMode,
                                             timeUpdateMethod,
                                             tweenType,
                                             animationCurve,
                                             coordinateMode,
                                             onStart,
                                             onUpdate,
                                             onComplete);

            newTransitionStep.AddToChain(transitionStep, runAtStart);
            return(newTransitionStep);
        }
 public Rotate(UnityEngine.GameObject target,
               Vector3?startRotation                = null,
               Vector3?endRotation                  = null,
               float delay                          = 0,
               float duration                       = 0.5f,
               TransitionModeType transitionMode    = TransitionModeType.Specified,
               TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
               AnimationCurve animationCurve        = null,
               TransitionStep.CoordinateSpaceType coordinateSpace = TransitionStep.CoordinateSpaceType.Global,
               Action onStart          = null,
               Action <float> onUpdate = null,
               Action onComplete       = null) :
     base(target, startRotation, endRotation, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType,
          animationCurve: animationCurve, coordinateSpace: coordinateSpace, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     Assert.AreNotEqual(CoordinateSpaceType.AnchoredPosition, CoordinateSpace, "AnchoredPosition is not supported for Rotate. Please change");
 }
        /// <summary>
        /// Rotate extension method for TransitionStep
        /// </summary>
        /// <typeparam name="T">interface type</typeparam>
        /// <param name="TransitionStep"></param>
        /// <returns></returns>
        public static Rotate Rotate(this TransitionStep transitionStep,
                                    Vector3 startRotation,
                                    Vector3 endRotation,
                                    float delay    = 0,
                                    float duration = 0.5f,
                                    TransitionStep.TransitionModeType transitionMode = TransitionStep.TransitionModeType.Specified,
                                    TransitionHelper.TweenType tweenType             = TransitionHelper.TweenType.linear,
                                    AnimationCurve animationCurve = null,
                                    TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global,
                                    bool runAtStart         = false,
                                    Action onStart          = null,
                                    Action <float> onUpdate = null,
                                    Action onComplete       = null)
        {
            var newTransitionStep = new Rotate(transitionStep.Target,
                                               startRotation,
                                               endRotation,
                                               delay,
                                               duration,
                                               transitionMode,
                                               tweenType,
                                               animationCurve,
                                               coordinateMode,
                                               onStart,
                                               onUpdate,
                                               onComplete);

            if (runAtStart)
            {
                transitionStep.AddOnStartTransitionStep(newTransitionStep);
            }
            else
            {
                transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            }
            newTransitionStep.Parent = transitionStep;
            return(newTransitionStep);
        }
Example #5
0
        /// <summary>
        /// Move extension method for TransitionStep
        /// </summary>
        /// <typeparam name="T">interface type</typeparam>
        /// <param name="TransitionStep"></param>
        /// <returns></returns>
        public static Move MoveFromOriginal(this TransitionStep transitionStep,
                                            Vector3 endPosition,
                                            float delay    = 0,
                                            float duration = 0.5f,
                                            TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                            AnimationCurve animationCurve        = null,
                                            TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global,
                                            bool runAtStart         = false,
                                            Action onStart          = null,
                                            Action <float> onUpdate = null,
                                            Action onComplete       = null)
        {
            var newTransitionStep = new Move(transitionStep.Target,
                                             Vector3.zero,
                                             endPosition,
                                             delay,
                                             duration,
                                             TransitionStep.TransitionModeType.FromCurrent,
                                             tweenType,
                                             animationCurve,
                                             coordinateMode,
                                             onStart,
                                             onUpdate,
                                             onComplete);

            if (runAtStart)
            {
                transitionStep.AddOnStartTransitionStep(newTransitionStep);
            }
            else
            {
                transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            }
            newTransitionStep.Parent = transitionStep;
            return(newTransitionStep);
        }