using System.Collections; using System.Collections.Generic; using UnityEngine; public class ConfigButtons : MonoBehaviour { public bool canClick = true; public void Clicked() { if (canClick) { StartCoroutine(clickWait()); canClick = false; } } IEnumerator clickWait() { Animator animator; animator = GetComponent(); animator.SetTrigger("click"); yield return new WaitForSecondsRealtime(.8f); canClick = true; } }