@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user