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