快捷键重构
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user