2026-06-08 08:55:10 +08:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Unity.VisualScripting;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
namespace Kill.UI.Components
|
|
|
|
|
{
|
2026-06-10 15:04:14 +08:00
|
|
|
|
2026-06-08 08:55:10 +08:00
|
|
|
public class MultiAnimationPLay : MonoBehaviour
|
|
|
|
|
{
|
2026-06-10 15:04:14 +08:00
|
|
|
public bool autoPlay;
|
2026-06-08 08:55:10 +08:00
|
|
|
public Animation[] animations;
|
|
|
|
|
public float waitTime;
|
|
|
|
|
public void PlayAni()
|
|
|
|
|
{
|
|
|
|
|
StartCoroutine(PLay());
|
|
|
|
|
}
|
|
|
|
|
IEnumerator PLay()
|
|
|
|
|
{
|
|
|
|
|
foreach (Animation a in animations)
|
|
|
|
|
{
|
|
|
|
|
a.gameObject.SetActive(true);
|
|
|
|
|
a.Play();
|
|
|
|
|
yield return new WaitForSeconds(waitTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void StopAni()
|
|
|
|
|
{
|
|
|
|
|
foreach (Animation a in animations)
|
|
|
|
|
{
|
|
|
|
|
a.gameObject.SetActive(false);
|
|
|
|
|
a.Stop();
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-06-10 15:04:14 +08:00
|
|
|
|
|
|
|
|
private void OnEnable() {
|
|
|
|
|
if(autoPlay)
|
|
|
|
|
PlayAni();
|
|
|
|
|
}
|
2026-06-08 08:55:10 +08:00
|
|
|
}
|
|
|
|
|
}
|