1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-21 17:56:08 +08:00

21 lines
541 B
C#

using UnityEngine;
using DG.Tweening;
public class PooledAnimation : MonoBehaviour
{
public void OnSpawn()
{
DOTweenAnimation doanim = this.GetComponent<DOTweenAnimation>();
if (doanim) doanim.DORestart(true);
DOTweenPath dopath = this.GetComponent<DOTweenPath>();
if (dopath) dopath.DORestart(true);
}
public void OnDespawn()
{
DOTweenAnimation doanim = this.GetComponent<DOTweenAnimation>();
if (doanim) doanim.DORewind();
DOTweenPath dopath = this.GetComponent<DOTweenPath>();
if (dopath) dopath.DORewind();
}
}