Hide
DOTweenPlay
Important
Enable SaintsEditor before using
Important
Use "Window" - "Saints Field" - "Enable DOTween Support" to enable this function

A method decorator to play a DOTween animation returned by the method.

The method should not have required parameters, and need to return a Tween or a Sequence (Sequence is actually also a tween).

Parameters:

  • [Optional] string label = null the label of the button. Use method name if null. Rich label not supported.
  • ETweenStop stopAction = ETweenStop.Rewind the action after the tween is finished or killed. Options are:
    • None: do nothing
    • Complete: complete the tween. This only works if the tween get killed
    • Rewind: rewind to the start state
// Please ensure you already have SaintsEditor enabled in your project before trying this example using SaintsField.Playa; using SaintsField; [GetComponent] public SpriteRenderer spriteRenderer; [DOTweenPlay] private Sequence PlayColor() { return DOTween.Sequence() .Append(spriteRenderer.DOColor(Color.red, 1f)) .Append(spriteRenderer.DOColor(Color.green, 1f)) .Append(spriteRenderer.DOColor(Color.blue, 1f)) .SetLoops(-1); // Yes you can make it a loop } [DOTweenPlay("Position")] private Sequence PlayTween2() { return DOTween.Sequence() .Append(spriteRenderer.transform.DOMove(Vector3.up, 1f)) .Append(spriteRenderer.transform.DOMove(Vector3.right, 1f)) .Append(spriteRenderer.transform.DOMove(Vector3.down, 1f)) .Append(spriteRenderer.transform.DOMove(Vector3.left, 1f)) .Append(spriteRenderer.transform.DOMove(Vector3.zero, 1f)) ; }

The first row is global control. Stop it there will stop all preview.

The check of each row means autoplay when you click the start in the global control.

Setup

To use DOTweenPlay: Tools - Demigaint - DOTween Utility Panel, click Create ASMDEF