mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-22 02:06:06 +08:00
21 lines
586 B
C#
21 lines
586 B
C#
using UnityEngine;
|
|
using DG.Tweening;
|
|
|
|
public class PooledChildAnimation : MonoBehaviour
|
|
{
|
|
public void OnSpawn()
|
|
{
|
|
DOTweenAnimation doanim = this.GetComponentInChildren<DOTweenAnimation>();
|
|
if (doanim) doanim.DORestart(true);
|
|
DOTweenPath dopath = this.GetComponentInChildren<DOTweenPath>();
|
|
if (dopath) dopath.DORestart(true);
|
|
}
|
|
|
|
public void OnDespawn()
|
|
{
|
|
DOTweenAnimation doanim = this.GetComponentInChildren<DOTweenAnimation>();
|
|
if (doanim) doanim.DORewind();
|
|
DOTweenPath dopath = this.GetComponentInChildren<DOTweenPath>();
|
|
if (dopath) dopath.DORewind();
|
|
}
|
|
} |