void OnGUI() { if (checkForKey) { // get the event Event e = Event.current; // if the event is a key, the set the hotkey to that key and stop checking for a new key if (e.isKey) { PlayerOptions.loadConfig(); changeHotkey(keyToChange, e.keyCode); PlayerOptions.saveConfig(); checkForKey = false; pauseScript.enabled = true; } } }
// changes all settings to default public void restoreToDefault() { PlayerOptions.configData.restoreDefaultConfig(); PlayerOptions.saveConfig(); }