Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

EditorPrefs doesn't work on 2018.2.10 ?

Discussion in 'Scripting' started by BaptisteB, Oct 9, 2018.

  1. BaptisteB

    BaptisteB

    Joined:
    Mar 11, 2015
    Posts:
    12
    Hello everyone!
    Just try to use EditorPrefs in Unity 2018.2.10. Work well on a single project but doesn't when trying to get the prefs in another project, which is the purpose of editorPrefs right?


    Code (CSharp):
    1.  
    2.     void Start ()
    3.     {
    4.         Debug.Log(EditorPrefs.GetString("EditorPrefsTest"));
    5.     }
    6.      
    7.     void Set()
    8.     {
    9.         EditorPrefs.SetString("EditorPrefsTest", "WORK");
    10.     }
    11.  
    12.  
    13.    
    I use this code in 2 projects.
    In project one, I use the Set() to set up the value of EditorPrefsTest.
    In project two, I just launch it and the Start() function send an empty string.
     
  2. BaptisteB

    BaptisteB

    Joined:
    Mar 11, 2015
    Posts:
    12
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,634
  4. BaptisteB

    BaptisteB

    Joined:
    Mar 11, 2015
    Posts:
    12
    Yes both the same Unity version
     
  5. BaptisteB

    BaptisteB

    Joined:
    Mar 11, 2015
    Posts:
    12
  6. BaptisteB

    BaptisteB

    Joined:
    Mar 11, 2015
    Posts:
    12
    New test on 2018.2.18f on two projects.
    Still doesn't work.

    Any idea?
     
  7. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,183
    @BaptisteB I noticed this as well in 2019.1. Do you know what the issue was?
     
  8. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,183
    Also, I thought EditorPrefs were project dependent. Is that not the case?