Files
ft/Client/Assets/Scripts/UI/PartnerStatue/EventPartnerStatueBuildToolView.cs
2026-06-29 21:18:33 +08:00

36 lines
757 B
C#

using UnityEngine;
using System.Threading.Tasks;
public class EventPartnerStatueBuildToolView : MonoBehaviour
{
[SerializeField] private Animation ani;
[SerializeField] private GameObject fxTool;
private void Reset()
{
ani = transform.Find(gameObject.name).GetComponent<Animation>();
}
public async void Play(float fxDelay)
{
try
{
ani.Play();
await Task.Delay(System.TimeSpan.FromSeconds(fxDelay));
PlayFx();
}
catch (System.Exception e)
{
Debug.LogError(e);
}
}
private void PlayFx()
{
if (fxTool == null)
return;
fxTool.SetActive(false);
fxTool.SetActive(true);
}
}