按键绑定功能
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
namespace NBF.Setting
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public abstract class InputOption : OptionBase
|
||||
{
|
||||
public abstract InputAction InputAction { get; }
|
||||
|
||||
protected override int DefaultValue => 0;
|
||||
|
||||
public override string GetDisplayString()
|
||||
{
|
||||
if (InputAction != null)
|
||||
{
|
||||
return InputAction.GetBindingDisplayString();
|
||||
}
|
||||
|
||||
return base.GetDisplayString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
namespace NBF.Setting
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public abstract class KeyBoardOption : InputOption
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
namespace NBF.Setting
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputAddBobSetting : KeyBoardOption
|
||||
{
|
||||
private int _defaultKey;
|
||||
public override string Name => "InputAddBob";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
protected override int DefaultValue => _defaultKey;
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.AddBob;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputChatSetting : KeyBoardOption
|
||||
{
|
||||
private int _defaultKey;
|
||||
public override string Name => "InputChat";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.Chat;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// PlayerInputControl.PlayerActions
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a63f66ee0a384cf0a163c33dfa2f3c36
|
||||
timeCreated: 1750308320
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputHelpSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputHelp";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.Help;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b77e15344964a9ab0b1ecafcad3d03d
|
||||
timeCreated: 1750308298
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputSubBobSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputSubBob";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.SubBob;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea72a2c910474d5ca4e96d2c881797d8
|
||||
timeCreated: 1750307386
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputToBagSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputToBag";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.ToBag;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 906eac0772874939a5223e1115d5dfe0
|
||||
timeCreated: 1750308244
|
||||
@@ -0,0 +1,19 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputUseTelescopeSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputUseTelescope";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.UseTelescope;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24089404fdb7424284ecafcd23d1537f
|
||||
timeCreated: 1750308215
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputUseTorchSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputUseTorch";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.UseTorch;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12a79769a6534afa8212293adfa1e48a
|
||||
timeCreated: 1750307422
|
||||
Reference in New Issue
Block a user