Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-819] Feature/core settings fix #226

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Editor/Core/Scripts/Settings/CoreSettingsLoader.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.IO;
using ReadyPlayerMe.Core.Data;
using UnityEditor;
using UnityEngine;
Expand All @@ -9,15 +10,15 @@ public static class CoreSettingsLoader
{
private const string PROJECT_RELATIVE_ASSET_PATH = "Assets/Ready Player Me/Resources/Settings/CoreSettings.asset";
private const string SETTINGS_SAVE_FOLDER = "Ready Player Me/Resources/Settings";

static CoreSettingsLoader()
{
EnsureSettingsExist();
}

public static void EnsureSettingsExist()
{
if (CoreSettingsHandler.CoreSettings == null)
if (CoreSettingsHandler.CoreSettings == null && !File.Exists($"{Application.dataPath}/Ready Player Me/Resources/Settings/CoreSettings.asset"))
{
CreateSettings();
}
Expand All @@ -32,4 +33,4 @@ private static void CreateSettings()
AssetDatabase.Refresh();
}
}
}
}
Loading