예제 #1
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);
        }
예제 #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> 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);
        }
예제 #3
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);
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
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);
        }
예제 #7
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);
        }
예제 #8
0
 public static FloatTween Create()
 {
     return(MrTween.CacheFloatTweens ? QuickCache <FloatTween> .Pop() : new FloatTween());
 }
예제 #9
0
 public static RectTween Create()
 {
     return(MrTween.CacheRectTweens ? QuickCache <RectTween> .Pop() : new RectTween());
 }
예제 #10
0
 public static Color32Tween Create()
 {
     return(MrTween.CacheColor32Tweens ? QuickCache <Color32Tween> .Pop() : new Color32Tween());
 }
예제 #11
0
 public static QuaternionTween Create()
 {
     return(MrTween.CacheQuaternionTweens ? QuickCache <QuaternionTween> .Pop() : new QuaternionTween());
 }
예제 #12
0
 public static Vector4Tween Create()
 {
     return(MrTween.CacheVector4Tweens ? QuickCache <Vector4Tween> .Pop() : new Vector4Tween());
 }
예제 #13
0
 public static IntTween Create()
 {
     return(MrTween.CacheIntTweens ? QuickCache <IntTween> .Pop() : new IntTween());
 }
예제 #14
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));
 }
예제 #15
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));
 }