36 lines
757 B
C#
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);
|
|
}
|
|
}
|