Search Unity

Custom settings

Discussion in 'Immediate Mode GUI (IMGUI)' started by DarthCoder, Mar 29, 2015.

  1. DarthCoder

    DarthCoder

    Joined:
    Aug 8, 2013
    Posts:
    6
    How does Unity support storing custom settings? I have a few singleton systems that I'd like to be able to set references to assets on in an inspector window. I've seen some extensions made custom editor windows for themselves and let you change settings there, but I can't figure out where those settings would be saved. If static variables get changed by an editor window do they serialize, or do most extensions just manually save paths and settings to some sort of config file?
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    If they're small, editor-only settings, store them in EditorPrefs.

    If they're for the project itself, use a ScriptableObject. Here's a good tutorial on scriptable objects.
     
    howong and DarthCoder like this.
  3. DarthCoder

    DarthCoder

    Joined:
    Aug 8, 2013
    Posts:
    6
    Perfect. ScriptableObject was just what I needed. Thanks!