using Invector; using Invector.vCharacterController; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class InputEventWrapper : MonoBehaviour { [vEditorToolbar("Input Mapping")] public GenericInput input = new GenericInput("K", "K", "K"); public UnityEvent OnButtonPressed; [SerializeField] private float buttonInputDelay = 0.5f; private float currentTime = 0f; public void LateUpdate() { if (currentTime >= 0) { currentTime -= Time.deltaTime; } if (input.GetButtonDown() && currentTime < 0) { currentTime = buttonInputDelay; OnButtonPressed?.Invoke(); } } }