代码格式化

Signed-off-by: Eicy <im@crash.work>
This commit is contained in:
2024-09-14 15:56:34 +08:00
parent 1614c6a29b
commit e601da9a96
10 changed files with 43 additions and 29 deletions

View File

@@ -12,7 +12,7 @@ namespace Keyboard
public string filePath;
private static KeySettingManager _instance;
public static KeySettingManager Instance
{
get
@@ -37,6 +37,7 @@ namespace Keyboard
{
_instance = this;
}
DontDestroyOnLoad(gameObject);
filePath = Application.persistentDataPath + "/" + "KeySetting.json";
LoadKeySettings();
@@ -88,7 +89,7 @@ namespace Keyboard
SaveKeySettings();
}
//更新Direction
private void Update()
{
@@ -121,12 +122,12 @@ namespace Keyboard
{
Direction = new Vector2(0, Direction.y);
}
if (Input.GetKey(GetKey("Up")) && Input.GetKey(GetKey("Down")))
{
Direction = new Vector2(Direction.x, 0);
}
if (!Input.GetKey(GetKey("Up")) && !Input.GetKey(GetKey("Down")))
{
Direction = new Vector2(Direction.x, 0);