Ejemplo n.º 1
0
        private Tween getTween(TweenBuilder builder)
        {
            if (builder.EaseFunction == null)
            {
                builder.WithEaseFunction(EaseFunctions.GetEaseFunction(builder.EaseType));
            }

            Tween tween = null;

            if (cachedTweens.Count > 0)
            {
                tween = cachedTweens.Dequeue();
            }
            else
            {
                tween = new Tween();
            }

            if (builder.UnscaledTime)
            {
                tween.Init(unscaledTime, builder);
            }
            else
            {
                tween.Init(time, builder);
            }
            tweens.AddLast(tween.Node);
            return(tween);
        }
Ejemplo n.º 2
0
        public static TweenHandler CreateTween(TweenBuilder builder)
        {
            builder.Tweener.Init(builder);
            Tween tween = I.getTween(builder);

            tween.Start();
            return(tween.GetHandler());
        }
Ejemplo n.º 3
0
 public void Init(TweenTime timeProvider, TweenBuilder builder)
 {
     this.timeProvider = timeProvider;
     this.tweener      = builder.Tweener;
     this.easeType     = builder.EaseType;
     this.tweenType    = builder.TweenType;
     this.easeFunction = builder.EaseFunction;
     this.duration     = builder.Duration;
     this.delayTime    = builder.Delay;
     this.handler      = builder.Handler;
     this.startTime    = 0;
     this.realTime     = 0;
     this.pauseTime    = 0;
 }
Ejemplo n.º 4
0
 /* Value tweens */
 public static TweenHandler FloatTo(this Material material, string propertyName, float dest, TweenBuilder builder)
 {
     builder.WithTweener(new MaterialFloatTweener(material, propertyName, dest));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 5
0
 public static TweenHandler MainColorTo(this Material material, Color dest, TweenBuilder builder)
 {
     builder.WithTweener(new MaterialColorTweener(material, "_Color", dest));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 6
0
 /* Transform tweens */
 public static TweenHandler MoveTo(this Transform transform, Vector3 dest, TweenBuilder builder)
 {
     builder.WithTweener(new TrPositionTweener(transform, dest));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 7
0
 public static TweenHandler ColorTo(this SpriteRenderer spriteRenderer, Color dest, TweenBuilder builder)
 {
     builder.WithTweener(new SpriteColorTweener(spriteRenderer, dest));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 8
0
 /* Color tweens */
 public static TweenHandler ColorTo(this Image image, Color dest, TweenBuilder builder)
 {
     builder.WithTweener(new ImageColorTweener(image, dest));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 9
0
 public static TweenHandler ChangeSizeDelta(this RectTransform transform, Vector2 dest, TweenBuilder builder)
 {
     builder.WithTweener(new TrSizeDeltaTweener(transform, dest));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 10
0
 public static TweenHandler MoveToWaypoints(this Transform transform, Vector3[] path, TweenBuilder builder)
 {
     builder.WithTweener(new TrPositionWaypointsTweener(transform, path));
     return(CoolestTween2.CreateTween(builder));
 }
Ejemplo n.º 11
0
 public Tween(TweenTime timeProvider, TweenBuilder builder)
 {
     Init(timeProvider, builder);
 }