File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed
Assets/Samples/RebindingUI Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change 1- using UnityEngine ;
2- using UnityEngine . InputSystem ;
3-
4- public class RebindSaveLoad : MonoBehaviour
1+ namespace UnityEngine . InputSystem . Samples . RebindUI
52{
6- public InputActionAsset actions ;
7-
8- public void OnEnable ( )
3+ public class RebindSaveLoad : MonoBehaviour
94 {
10- var rebinds = PlayerPrefs . GetString ( "rebinds" ) ;
11- if ( ! string . IsNullOrEmpty ( rebinds ) )
12- actions . LoadBindingOverridesFromJson ( rebinds ) ;
13- }
5+ public InputActionAsset actions ;
146
15- public void OnDisable ( )
16- {
17- var rebinds = actions . SaveBindingOverridesAsJson ( ) ;
18- PlayerPrefs . SetString ( "rebinds" , rebinds ) ;
7+ public void OnEnable ( )
8+ {
9+ var rebinds = PlayerPrefs . GetString ( "rebinds" ) ;
10+ if ( ! string . IsNullOrEmpty ( rebinds ) )
11+ actions . LoadBindingOverridesFromJson ( rebinds ) ;
12+ }
13+
14+ public void OnDisable ( )
15+ {
16+ var rebinds = actions . SaveBindingOverridesAsJson ( ) ;
17+ PlayerPrefs . SetString ( "rebinds" , rebinds ) ;
18+ }
1919 }
2020}
You can’t perform that action at this time.
0 commit comments