예제 #1
0
    public void RestorePreferences()
    {
        if (!File.Exists(PreferencesSavePath))
        {
            return;
        }
        string PreferencesStr = File.ReadAllText(PreferencesSavePath);

        Preferences = JsonConvert.DeserializeObject <Lanotalium.PreferencesContainer>(PreferencesStr);
        if (Preferences.Build < Build)
        {
            Preferences.HideWhatsNew    = false;
            Preferences.DoNotRunAsAdmin = false;
            Preferences.LapInjected     = false;
            if (Build == 44)
            {
                EditorManager.ResetEditorLayout();
            }
        }
        Preferences.Build = Build;
        if (!File.Exists(EditorLayoutSavePath))
        {
            return;
        }
        string EditorLayoutStr = File.ReadAllText(EditorLayoutSavePath);

        EditorLayout = JsonConvert.DeserializeObject <Lanotalium.Editor.EditorLayout>(EditorLayoutStr);
        if (EditorManager != null)
        {
            EditorManager.RestoreEditorLayout();
        }
    }
예제 #2
0
    private void Start()
    {
#if UNITY_IOS
        PreferencesSavePath = Application.persistentDataPath + "/Lanotalium/Preferences.json";
        AppDataRoaming      = Application.persistentDataPath + "/Lanotalium";
#endif
        if (!Directory.Exists(AppDataRoaming))
        {
            Directory.CreateDirectory(AppDataRoaming);
        }
        if (File.Exists(PreferencesSavePath))
        {
            SceneManager.LoadScene(1);
            return;
        }
        else
        {
            FirstRunPanel.SetActive(true);
            Preferences = new Lanotalium.PreferencesContainer();
        }
    }