Skip to content

Commit

Permalink
chore: simplify check
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Feb 14, 2024
1 parent 618ff5f commit 6f32c37
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Editor/Core/Scripts/Settings/CoreSettingsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,14 @@ static CoreSettingsLoader()

public static void EnsureSettingsExist()
{
if (CoreSettingsHandler.CoreSettings == null && AssetDatabase.LoadAssetAtPath<CoreSettings>(PROJECT_RELATIVE_ASSET_PATH) == null)
if (CoreSettingsHandler.CoreSettings == null && !File.Exists($"{Application.dataPath}/Ready Player Me/Resources/Settings/CoreSettings.asset"))
{
CreateSettings();
}
}

private static void CreateSettings()
{

if (Directory.Exists($"{Application.dataPath}/{SETTINGS_SAVE_FOLDER}"))
{
Debug.Log($"Settings exist {PROJECT_RELATIVE_ASSET_PATH} skipping");
return;
}
Debug.Log($"Settings not found at {Application.dataPath}/{PROJECT_RELATIVE_ASSET_PATH}");

DirectoryUtility.ValidateDirectory($"{Application.dataPath}/{SETTINGS_SAVE_FOLDER}");
var newSettings = ScriptableObject.CreateInstance<CoreSettings>();
AssetDatabase.CreateAsset(newSettings, PROJECT_RELATIVE_ASSET_PATH);
Expand Down

0 comments on commit 6f32c37

Please sign in to comment.