Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RebindSaveLoad.cs 487B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using UnityEngine.InputSystem;
  3. public class RebindSaveLoad : MonoBehaviour
  4. {
  5. public InputActionAsset actions;
  6. public void OnEnable()
  7. {
  8. var rebinds = PlayerPrefs.GetString("rebinds");
  9. if (!string.IsNullOrEmpty(rebinds))
  10. actions.LoadBindingOverridesFromJson(rebinds);
  11. }
  12. public void OnDisable()
  13. {
  14. var rebinds = actions.SaveBindingOverridesAsJson();
  15. PlayerPrefs.SetString("rebinds", rebinds);
  16. }
  17. }