コード例 #1
0
ファイル: TweenTestBed.cs プロジェクト: Marwan0/tlplib
        public void Start()
        {
//      var obj3T = TweenLerp.vector3.tween(
//        obj3.position, obj3.position + Vector3.right * 10, Eases.linear, duration
//      );
//      var obj23T = obj2T
//      var obj4T = TweenLerp.vector3.tween(
//        obj4.position, obj4.position + Vector3.right * 10, Eases.quadratic, duration
//      );
//      var obj4T2 = TweenLerp.vector3.tween(
//        obj4T.end, obj4T.end + Vector3.right * 10, Eases.quadratic, duration
//      );
//
//      //
//
            var t1  = obj1.tweenPositionRelative(Vector3.right * 2, Eases.linear, duration);
            var tra = TweenSequence.sequential(
                Tween.callback(_ => print($"start {_}")),
                t1,
                Tween.callback(_ => print($"1 {_}")),
                obj2.tweenPositionRelative(Vector3.right * 2, Eases.linear, duration),
                Tween.callback(_ => print($"2 {_}")),
                t1.tweenPositionRelative(Vector3.right * 2, Eases.linear, duration),
                Tween.callback(_ => print($"end {_}"))
                ).build();
            var tr = TweenSequence.sequential(
                /*tra, tra.reversed(), tra.reversed().reversed(), */ tra.reversed()
                ).build();

            manager = tr.managed()
                      .onStart(forwards => indicator.color = forwards ? Color.black : Color.green)
                      .onEnd(forwards => indicator.color   = forwards ? Color.gray : Color.red);

//      var tr1 =
//        TweenSequence.Builder.create()
//          .append(obj1.tweenPositionRelative(Vector3.right * 10, Eases.cubic, duration))
//          .append(obj2.tweenPositionRelative(Vector3.right * 10, Eases.sin, duration))
//          .build();
//
//      tr =
//        TweenSequence.Builder.create()
//          .append(tr1)
//          .insert(1, obj3.tweenPositionRelative(Vector3.right * 10, Eases.linear, duration))
//          .append(obj4.tweenPositionRelative(Vector3.right * 10, Eases.cubic, duration))
//          .append(obj4.tweenPosition(Vector3.left * 10, Eases.quadratic, duration))
//          .build();
//
//      ASync.WithDelay(tr.totalDuration, tr.reset);
//      ASync.WithDelay(tr.totalDuration * 2, tr.reset);
        }
コード例 #2
0
 public static TweenSequence single(this TweenSequenceElement element) =>
 TweenSequence.single(element);
コード例 #3
0
ファイル: TweenManager.cs プロジェクト: ArnasJ/tlplib
 public static TweenManager managed(
     this TweenSequenceElement sequence, TweenManager.Loop looping, TweenTime time = TweenTime.OnUpdate,
     float delay = 0
     ) => new TweenManager(TweenSequence.single(sequence, delay), time, looping);