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(); } 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); } }