Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.34k stars 351 forks source link

Dotween Update and Start CallBack #632

Open wujiaze opened 1 year ago

wujiaze commented 1 year ago
    void Update()
    {
      if (Input.GetKeyDown(KeyCode.E))
        {
            // blackTrans is a cube
            Tween t = blackTrans.DOMove(new Vector3(5, 5, 5), 2)
                .SetDelay(5)
                .OnStart(TweenStart)
                .OnComplete(TweenComplete)
                .OnUpdate(TweenUpdate);
            Sequence seq = DOTween.Sequence();
            seq.Append(t)
                .PrependInterval(5)
                .AppendInterval(5)
                .SetDelay(5, false) 
                .OnStart(SequenceStart)
                .OnComplete(SequenceComplete)
                .OnStepComplete(SequenceStepComplete)
                .OnUpdate(SequenceUpdate)
                .SetLoops(2);
         }
    }
    private void TweenStart()
    {
        print("OnTweenStart");
    }
    private void TweenComplete()
    {
        print("OnTweenComplete");
    }
    private void TweenUpdate()
    {
        print("TweenUpdate");
    }
    private void SequenceStart()
    {
        print("OnSequenceStart");
    }

    private void SequenceStepComplete()
    {
        print("OnSequenceStepComplete");
    }

    private void SequenceComplete()
    {
        print("OnSequenceComplete");
    }

    private void SequenceUpdate()
    {
        print("SequenceUpdate");
    }

This is the flowchart I built ,the issues is the red texts image This is the Console. There's an TweenUpdate there image

wujiaze commented 1 year ago

DotweenPro 1.0.335