快捷键重构

This commit is contained in:
2025-05-25 00:54:06 +08:00
parent d6327c7946
commit 68b88d57db
186 changed files with 2248 additions and 1066 deletions

View File

@@ -15,8 +15,9 @@ namespace NBF
{
base.OnShow();
InputManager.OnInteractiveObjectAction += OnInteractiveObjectAction;
InputManager.OnUseAction += OnUseAction;
InputManager.OnUse2Action += OnUse2Action;
InputManager.OnPlayerCanceled += OnPlayerCanceled;
// InputManager.OnUseAction += OnUseAction;
// InputManager.OnUse2Action += OnUse2Action;
}
protected override void OnUpdate()
@@ -38,28 +39,27 @@ namespace NBF
}
}
private void OnUseAction()
private void OnPlayerCanceled(string action)
{
if (Interactive.visible)
{
Interactive.Use1();
if (action == "Use1")
{
Interactive.Use1();
}
else if (action == "Use2")
{
Interactive.Use2();
}
}
}
private void OnUse2Action()
{
if (Interactive.visible)
{
Interactive.Use2();
}
}
protected override void OnHide()
{
base.OnHide();
InputManager.OnInteractiveObjectAction -= OnInteractiveObjectAction;
InputManager.OnUseAction -= OnUseAction;
InputManager.OnUse2Action -= OnUse2Action;
InputManager.OnUICanceled -= OnPlayerCanceled;
}
}
}