示例#1
0
        public static ITween <Color32> color32PropertyTo(object self, string propertyName, Color32 to, float duration)
        {
            var tweenTarget = new PropertyTarget <Color32>(self, propertyName);
            var tween       = ZestKit.cacheColor32Tweens ? QuickCache <Color32Tween> .pop() : new Color32Tween();

            tween.initialize(tweenTarget, to, duration);

            return(tween);
        }
示例#2
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> ZKlocalEulersTo(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);
        }
示例#3
0
        public static ITween <Vector4> vector4PropertyTo(object self, string propertyName, Vector4 to, float duration)
        {
            var tweenTarget = new PropertyTarget <Vector4>(self, propertyName);
            var tween       = ZestKit.cacheVector4Tweens ? QuickCache <Vector4Tween> .pop() : new Vector4Tween();

            tween.initialize(tweenTarget, to, duration);

            return(tween);
        }
示例#4
0
文件: Tweens.cs 项目: r618/ZestKit
        public override void recycleSelf()
        {
            base.recycleSelf();

            if (_shouldRecycleTween && ZestKit.cacheFloatTweens)
            {
                QuickCache <FloatTween> .push(this);
            }
        }
示例#5
0
        public static ITween <Quaternion> quaternionPropertyTo(object self, string propertyName, Quaternion to, float duration)
        {
            var tweenTarget = new PropertyTarget <Quaternion>(self, propertyName);
            var tween       = ZestKit.cacheQuaternionTweens ? QuickCache <QuaternionTween> .pop() : new QuaternionTween();

            tween.initialize(tweenTarget, to, duration);

            return(tween);
        }
示例#6
0
        public static ITween <int> intPropertyTo(object self, string propertyName, int to, float duration)
        {
            var tweenTarget = new PropertyTarget <int>(self, propertyName);
            var tween       = ZestKit.cacheIntTweens ? QuickCache <IntTween> .pop() : new IntTween();

            tween.initialize(tweenTarget, to, duration);

            return(tween);
        }
示例#7
0
 public override void recycleSelf()
 {
     if (_shouldRecycleTween)
     {
         _target    = null;
         _nextTween = null;
         _transform = null;
         QuickCache <TransformVector3Tween> .push(this);
     }
 }
示例#8
0
        public override void recycleSelf()
        {
            _unfilteredElapsedTime = _elapsedTime = _initialDelay = _repeatDelay = 0f;
            _isPaused         = _isCurrentlyManagedByZestKit = _repeats = _isTimeScaleIndependent = false;
            context           = null;
            _action           = null;
            _continueWithTask = _waitForTask = null;

            QuickCache <ActionTask> .push(this);
        }
示例#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);
        }
示例#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);
        }
示例#11
0
文件: Tweens.cs 项目: r618/ZestKit
 public static FloatTween create()
 {
     return(ZestKit.cacheFloatTweens ? QuickCache <FloatTween> .pop() : new FloatTween());
 }
示例#12
0
文件: Tweens.cs 项目: r618/ZestKit
 public static RectTween create()
 {
     return(ZestKit.cacheRectTweens ? QuickCache <RectTween> .pop() : new RectTween());
 }
示例#13
0
文件: Tweens.cs 项目: r618/ZestKit
 public static Color32Tween create()
 {
     return(ZestKit.cacheColor32Tweens ? QuickCache <Color32Tween> .pop() : new Color32Tween());
 }
示例#14
0
文件: Tweens.cs 项目: r618/ZestKit
 public static QuaternionTween create()
 {
     return(ZestKit.cacheQuaternionTweens ? QuickCache <QuaternionTween> .pop() : new QuaternionTween());
 }
示例#15
0
文件: Tweens.cs 项目: r618/ZestKit
 public static Vector4Tween create()
 {
     return(ZestKit.cacheVector4Tweens ? QuickCache <Vector4Tween> .pop() : new Vector4Tween());
 }
示例#16
0
文件: Tweens.cs 项目: r618/ZestKit
 public static IntTween create()
 {
     return(ZestKit.cacheIntTweens ? QuickCache <IntTween> .pop() : new IntTween());
 }
示例#17
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));
 }
示例#18
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));
 }