Search Unity

Save settings for editor script for all projects

Discussion in 'Immediate Mode GUI (IMGUI)' started by prankard, Feb 22, 2016.

  1. prankard

    prankard

    Joined:
    Mar 24, 2010
    Posts:
    19
    Hey Devs.

    So a lot of unity editor scripts make Scriptable Objects in order to save user settings.

    So for example, in the tweening engine DoTween they dump a .asset in the Resources folder called 'DOTweenSettings.asset' which has some customisation about all tweens, which is loaded at runtime before the first tween is executed.

    This is great, I can see we can make scriptable assets for some settings, but what if the setting you want to save is global. So for every time the user has your extension in many projects, they can share the same settings.

    Does unity have a place for this to go? I noticed there is a path called
    EditorApplication.applicationContentsPath

    On windows this points to:
    C:/Program Files/Unity/Editor/Data

    Which contains a lot of tools the editor uses. I saw this directory:
    C:\Program Files\Unity\Editor\Data\UnityExtensions\Unity

    Which contains DLLs for:
    EditorTestsRunner
    UnityAnalytics
    Advertisements

    Which I thought were global settings for these extensions. But realised that all the files are Unity's internal extensions for the editor which look like they work in a different way (I think it includes all the .dll if they are used at build time, but don't know how they work. Cool looking ivy.xml files though :)).

    Does anyone know if I can save in the EditorApplication.applicationContentsPath? Strange that we can't since they give us access to the path.
    My biggest worry, is if I make my own folder, the folder might get deleted when I upgrade Unity.

    Or is there another method or place that I can save a file or flags/strings?

    Thanks for reading.
     
  2. skalev

    skalev

    Joined:
    Feb 16, 2012
    Posts:
    264
    slaczky likes this.