Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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,533
    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!