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); }
/// <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); }
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); }
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); }
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); }
/// <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); }
/// <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); }
public static FloatTween Create() { return(MrTween.CacheFloatTweens ? QuickCache <FloatTween> .Pop() : new FloatTween()); }
public static RectTween Create() { return(MrTween.CacheRectTweens ? QuickCache <RectTween> .Pop() : new RectTween()); }
public static Color32Tween Create() { return(MrTween.CacheColor32Tweens ? QuickCache <Color32Tween> .Pop() : new Color32Tween()); }
public static QuaternionTween Create() { return(MrTween.CacheQuaternionTweens ? QuickCache <QuaternionTween> .Pop() : new QuaternionTween()); }
public static Vector4Tween Create() { return(MrTween.CacheVector4Tweens ? QuickCache <Vector4Tween> .Pop() : new Vector4Tween()); }
public static IntTween Create() { return(MrTween.CacheIntTweens ? QuickCache <IntTween> .Pop() : new IntTween()); }
/// <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)); }
/// <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)); }