- Home /
Change unity preferences by script
How is it possible to change values in preferences?
I have found calling EditorPrefs.SetString
would change some registry key inside HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Unity Editor 5.x
(I'm using windows).
I understand values are stored here, but nothing happens if I edit them (I believe these values are loaded from registry when I open unity).
I've noticed that when I update Preferences, values got with EditorPrefs.GetString
change, but if I try to change them Preferences do not change.
I think I should call some refresh method, but I have no ideas
Well, my aim was to change Handles.selectedColor
(that is read-only) from script, to use Handles.Free$$anonymous$$oveHandle
with custom color. This color can be set from Preferences > Colors > Scene > Selected Axis, but I didn't find classes to change this data
Did you ever find a resolution to this? I'm trying to set EditorPrefs background color via C# and can not figure out how to update editor prefs to do so..