Skip to content

Commit afecc2a

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Get package version from asset if SDK added as asset
1 parent 3c2aae7 commit afecc2a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Runtime/Game/Resources/LootLockerConfig.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ static void StoreSDKVersion()
121121
EditorApplication.update += ListRequestProgress;
122122
}
123123

124+
private class LLPackageDescription
125+
{
126+
public string version;
127+
}
128+
124129
static void ListRequestProgress()
125130
{
126131
if (ListInstalledPackagesRequest.IsCompleted)
@@ -134,6 +139,11 @@ static void ListRequestProgress()
134139
break;
135140
}
136141
}
142+
143+
if (string.IsNullOrEmpty(LootLockerConfig.current.sdk_version))
144+
{
145+
LootLockerConfig.current.sdk_version = LootLockerJson.DeserializeObject<LLPackageDescription>(File.ReadAllText("Assets/LootLockerSDK/package.json")).version;
146+
}
137147
}
138148
}
139149
#endif

0 commit comments

Comments
 (0)