Prefs GUI by fuqunaga - 4


accessor and GUI set for Unity PlayerPrefs / JSON file

Unknown VersionOtherUpdated 45 days agoCreated on September 16th, 2016
Go to source


Accessor and GUI set for Unity PlayerPrefs / JSON file

public class PrefsGUISample : PrefsGUISampleBase
    public class PrefsEnum : PrefsParam<EnumSample>
        public PrefsEnum(string key, EnumSample defaultValue = default(EnumSample)) : base(key, defaultValue) { }

    // define PrefsParams with key.
    public PrefsEnum _prefsEnum = new PrefsEnum("PrefsEnum");
    public PrefsString _prefsString = new PrefsString("PrefsString");
    public PrefsInt _prefsInt = new PrefsInt("PrefsInt");
    public PrefsFloat _prefsFloat = new PrefsFloat("PrefsFloat");
    public PrefsBool _prefsBool = new PrefsBool("PrefsBool");
    public PrefsVector2 _prefsVector2 = new PrefsVector2("PrefsVector2");
    public PrefsVector3 _prefsVector3 = new PrefsVector3("PrefsVector3");
    public PrefsVector4 _prefsVector4 = new PrefsVector4("PrefsVector4");
    public PrefsColor _prefsColor = new PrefsColor("PrefsColor");

    protected override void OnGUIInternal()

        // return true if value was changed
        if ( _prefsColor.OnGUISlider())
            // use as native type
            Color color = _prefsColor;
            Debug.Log("Changed. " + color);

        if (GUILayout.Button("Save")) Prefs.Save();
        if (GUILayout.Button("DeleteAll")) Prefs.DeleteAll();


Download a .unitypackage file from Release page.


Using Pacakge Manager:
Add following line to the dependencies section in the Packages/manifest.json.

"ga.fuquna.prefsgui": ""


  • List up Prefs and can modify
  • You can also feed back the current value as default value
  • You can edit the key prefix for each GameObject by displaying it in order of GameObject


  • auto sync All Prefs
  • You can ignore it by specifying it with EditorWindow

Switch PlayerPrefs / JSON

Switch using at PrefsWrapper.cs

JSON file path

Application.persistentDataPath + "/Prefs.json"

You can customize by placing PrefsWrapperPathCustom in the scene and set _path field.
also can use the Special folders and enviroment variables.

- %dataPath% -> Application.dataPath
- %companyName% -> Application.companyName
- %productName% -> Application.productName
- other %[word]% -> System.Environment.GetEnvironmentVariable([word])


Auto create material GUI menu



Show all projects by fuqunaga