Skip to content

Commit

Permalink
fix: recreates ProjectSettings scriptable object when the project is …
Browse files Browse the repository at this point in the history
…pulled from GitHub

close #200
  • Loading branch information
mob-sakai committed Sep 21, 2024
1 parent 6e5a7f9 commit 9f6ea22
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ private static void Initialize()
var defaultSettings = GetDefaultSettings(t);
if (!defaultSettings)
{
// When create a new instance, automatically set it as default settings.
defaultSettings = t.GetProperty("instance", flags)
?.GetValue(null, null) as PreloadedProjectSettings;
SetDefaultSettings(defaultSettings);
}
else if (GetPreloadedSettings(t).Length != 1)
{
Expand Down Expand Up @@ -73,6 +73,7 @@ protected static PreloadedProjectSettings GetDefaultSettings(Type type)

protected static void SetDefaultSettings(PreloadedProjectSettings asset)
{
if (!asset) return;
var type = asset.GetType();
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset)))
{
Expand Down

0 comments on commit 9f6ea22

Please sign in to comment.