Exemplo n.º 1
0
        public static ITween <int> IntPropertyTo(object self, string propertyName, int to, float duration)
        {
            var tweenTarget = new PropertyTarget <int>(self, propertyName);
            var tween       = MrTween.CacheIntTweens ? QuickCache <IntTween> .Pop() : new IntTween();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }
Exemplo n.º 2
0
        public static ITween <Quaternion> QuaternionPropertyTo(object self, string propertyName, Quaternion to, float duration)
        {
            var tweenTarget = new PropertyTarget <Quaternion>(self, propertyName);
            var tween       = MrTween.CacheQuaternionTweens ? QuickCache <QuaternionTween> .Pop() : new QuaternionTween();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }
Exemplo n.º 3
0
        public static ITween <Color32> Color32PropertyTo(object self, string propertyName, Color32 to, float duration)
        {
            var tweenTarget = new PropertyTarget <Color32>(self, propertyName);
            var tween       = MrTween.CacheColor32Tweens ? QuickCache <Color32Tween> .Pop() : new Color32Tween();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }
Exemplo n.º 4
0
        public override void RecycleSelf()
        {
            base.RecycleSelf();

            if (_shouldRecycleTween && MrTween.CacheFloatTweens)
            {
                QuickCache <FloatTween> .Push(this);
            }
        }
Exemplo n.º 5
0
        public static ITween <Vector4> Vector4PropertyTo(object self, string propertyName, Vector4 to, float duration)
        {
            var tweenTarget = new PropertyTarget <Vector4>(self, propertyName);
            var tween       = MrTween.CacheVector4Tweens ? QuickCache <Vector4Tween> .Pop() : new Vector4Tween();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }
Exemplo n.º 6
0
        /// <summary>
        /// transform.localEulers tween
        /// </summary>
        /// <returns>The klocal eulers to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween <Vector3> LocalEulersTo(this Transform self, Vector3 to, float duration = 0.3f)
        {
            var tween = QuickCache <TransformVector3Tween> .Pop();

            tween.SetTargetAndType(self, TransformTargetType.LocalEulerAngles);
            tween.Initialize(tween, to, duration);

            return(tween);
        }
Exemplo n.º 7
0
 public override void RecycleSelf()
 {
     if (_shouldRecycleTween)
     {
         _target    = null;
         _nextTween = null;
         _transform = null;
         QuickCache <TransformVector3Tween> .Push(this);
     }
 }
Exemplo n.º 8
0
        public override void RecycleSelf()
        {
            _unfilteredElapsedTime = _elapsedTime = _initialDelay = _repeatDelay = 0f;
            _isPaused         = _isCurrentlyManagedByMrTween = _repeats = _isTimeScaleIndependent = false;
            Context           = null;
            _action           = null;
            _continueWithTask = _waitForTask = null;

            QuickCache <ActionTask> .Push(this);
        }
Exemplo n.º 9
0
        /// <summary>
        /// calls the action after an initial delay. The ActionTask is automatically started for you.
        /// </summary>
        /// <param name="initialDelay">Initial delay.</param>
        /// <param name="context">Context.</param>
        /// <param name="action">Action.</param>
        public static ActionTask AfterDelay(float initialDelay, object context, Action <ActionTask> action)
        {
            var task = QuickCache <ActionTask> .Pop()
                       .SetAction(action)
                       .SetDelay(initialDelay)
                       .SetContext(context);

            task.Start();

            return(task);
        }
Exemplo n.º 10
0
        /// <summary>
        /// calls the Action every repeatsDelay seconds. The ActionTask is automatically started for you.
        /// </summary>
        /// <param name="initialDelay">Initial delay.</param>
        /// <param name="repeatDelay">Repeat delay.</param>
        /// <param name="context">Context.</param>
        /// <param name="action">Action.</param>
        public static ActionTask Every(float repeatDelay, object context, Action <ActionTask> action)
        {
            var task = QuickCache <ActionTask> .Pop()
                       .SetAction(action)
                       .SetRepeats(repeatDelay)
                       .SetContext(context);

            task.Start();

            return(task);
        }
Exemplo n.º 11
0
 /// <summary>
 /// creates an ActionTask but does not start it!
 /// </summary>
 /// <param name="action">Action.</param>
 public static ActionTask Create(Action <ActionTask> action)
 {
     return(QuickCache <ActionTask> .Pop()
            .SetAction(action));
 }
Exemplo n.º 12
0
 public static FloatTween Create()
 {
     return(MrTween.CacheFloatTweens ? QuickCache <FloatTween> .Pop() : new FloatTween());
 }
Exemplo n.º 13
0
 public static RectTween Create()
 {
     return(MrTween.CacheRectTweens ? QuickCache <RectTween> .Pop() : new RectTween());
 }
Exemplo n.º 14
0
 public static Color32Tween Create()
 {
     return(MrTween.CacheColor32Tweens ? QuickCache <Color32Tween> .Pop() : new Color32Tween());
 }
Exemplo n.º 15
0
 public static QuaternionTween Create()
 {
     return(MrTween.CacheQuaternionTweens ? QuickCache <QuaternionTween> .Pop() : new QuaternionTween());
 }
Exemplo n.º 16
0
 public static Vector4Tween Create()
 {
     return(MrTween.CacheVector4Tweens ? QuickCache <Vector4Tween> .Pop() : new Vector4Tween());
 }
Exemplo n.º 17
0
 public static IntTween Create()
 {
     return(MrTween.CacheIntTweens ? QuickCache <IntTween> .Pop() : new IntTween());
 }
Exemplo n.º 18
0
 /// <summary>
 /// creates an ActionTask with a context but does not start it!
 /// </summary>
 /// <param name="context">Context.</param>
 /// <param name="action">Action.</param>
 public static ActionTask Create(object context, Action <ActionTask> action)
 {
     return(QuickCache <ActionTask> .Pop()
            .SetAction(action)
            .SetContext(context));
 }