设置分组

This commit is contained in:
bob
2025-06-10 14:57:35 +08:00
parent 1d3d4adbf5
commit 9963e4a51e
144 changed files with 8755 additions and 70 deletions

View File

@@ -0,0 +1,20 @@
using UnityEngine;
using UnityEngine.InputSystem;
public class RebindSaveLoad : MonoBehaviour
{
public InputActionAsset actions;
public void OnEnable()
{
var rebinds = PlayerPrefs.GetString("rebinds");
if (!string.IsNullOrEmpty(rebinds))
actions.LoadBindingOverridesFromJson(rebinds);
}
public void OnDisable()
{
var rebinds = actions.SaveBindingOverridesAsJson();
PlayerPrefs.SetString("rebinds", rebinds);
}
}