This commit is contained in:
2025-05-14 16:14:32 +08:00
parent 543b38d930
commit 9e4fef3f1e
16 changed files with 358 additions and 27 deletions

View File

@@ -36,11 +36,15 @@ namespace NBF
App.Inst.SetMouseCurrsor(false);
InputManager.OnQuickIndexAction += OnQuickIndexAction;
InputManager.OnUseTorchAction += OnUseTorchAction;
InputManager.OnUseTelescopeAction += OnUseTelescopeAction;
}
private void OnDestroy()
{
InputManager.OnQuickIndexAction -= OnQuickIndexAction;
InputManager.OnUseTorchAction -= OnUseTorchAction;
InputManager.OnUseTelescopeAction -= OnUseTelescopeAction;
}
private void EnableFirstPersonController()
@@ -53,6 +57,23 @@ namespace NBF
nextShowSlotIndex = index;
}
private void OnUseTorchAction(bool ret)
{
if (!ret)
{
_player.Data.openLight = !_player.Data.openLight;
}
}
private void OnUseTelescopeAction(bool ret)
{
if (!ret)
{
_player.Data.openTelescope = !_player.Data.openTelescope;
_player.ToggleTelescope();
}
}
private void Update()
{
var movementAxis = InputManager.GetMovementInput();