DoTween joint use of animation Sequence

Sequence of several methods:

Append(Tween tween)

Finally, add a tween in the Sequence.

AppendCallback(TweenCallback callback)

Finally, add a callback function Sequence of.

AppendInterval(float interval)

Add some time in the last interval of Sequence.

Insert(float atPosition,Tween tween)

Placed at a given position on a tween time, the effect may be achieved simultaneously playing a plurality of tween, rather than one by one player.

InsertCallback(float atPosition, TweenCallback callback)

Placing a callback at a given time position.

Join(Tween tween)

At the beginning of the last tween Sequence of placing a tween. The effect can be achieved while playing multiple tween, rather than one after the other player.

Prepend(Tween tween)

Sequence inserted at the beginning of a tween, moved back the original content based on time.

PrependCallback(TweenCallback callback)

Insert a callback function at the beginning of Sequence.

PrependInterval(float interval)

Inserted at the beginning of a time interval Sequence, moved back the original content based on time.

Sequence is a simple example:

private Text mText;

public float duration = 1;
public Vector3 scaleEnd = Vector3.one;
public Color colorEnd = Color.red;

private Sequence mSequence;

private void Awake()
{
    mText = GetComponent<Text>();
    mSequence = DOTween.Sequence();
    mSequence.Append(transform.DOScale(scaleEnd, duration));
    mSequence.Join(mText.DOColor(colorEnd, duration));
    mSequence.SetAutoKill(false);
    mSequence.Pause();
}

private void Update()
{
    if (Input.GetKeyUp(KeyCode.O))
    {
        PlayForward();
    }
    else if (Input.GetKeyUp(KeyCode.P))
    {
        PlayBackWard();
    }
}

public void PlayForward()
{
    mSequence.PlayForward();
}
public void PlayBackWard()
{
    mSequence.PlayBackwards();
}

 

Guess you like

Origin www.cnblogs.com/luoyanghao/p/11220407.html