ZoeRobotIngles/Assets/Scripts/Config/ConfigButtons.cs

28 lines
540 B
C#

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>();
animator.SetTrigger("click");
yield return new WaitForSecondsRealtime(.8f);
canClick = true;
}
}