Search Unity

Bug EditorPrefs.SetInt doesn't work on Mac

Discussion in 'Editor & General Support' started by Kwahusss, Jul 15, 2021.

  1. Kwahusss

    Kwahusss

    Joined:
    Sep 21, 2015
    Posts:
    13
    Hi, I have the next code
    Code (CSharp):
    1. int currentBuildNumber = EditorPrefs.GetInt(LastBuildNumberStorageName);
    2. currentBuildNumber += 1;
    3. EditorPrefs.SetInt(LastBuildNumberStorageName, currentBuildNumber);
    If I have in my pref value 1, after increment and SetInt I should have 2 in my perf. But if I do GetInt after line 3 in example code, I still have value 1 in my pref. On Windows this code works as expected.

    My work environment:
    Unity 2021.1.14f1
    I run current code in -batchmode via our CI
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281