Passion & UI

This commit is contained in:
SoulliesOfficial
2026-06-12 17:11:39 -04:00
parent 7bc1e1722c
commit 6d7ebc5825
3444 changed files with 865284 additions and 463132 deletions

View File

@@ -0,0 +1,28 @@
using UnityEngine;
using UnityEngine.Events;
namespace Michsky.UI.Shift
{
public class PressKeyEvent : MonoBehaviour
{
[Header("Key")]
public KeyCode hotkey;
public bool pressAnyKey;
public bool invokeAtStart;
[Header("Action")]
public UnityEvent pressAction;
void Start()
{
if (invokeAtStart)
pressAction?.Invoke();
}
void Update()
{
if (pressAnyKey && Input.anyKeyDown) { pressAction?.Invoke(); }
else if (Input.GetKeyDown(hotkey)) { pressAction?.Invoke(); }
}
}
}