Feat: Add "Check for updates" functionality to the SDK#474
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an Editor-only SDK update checker that queries GitHub Releases and notifies developers when a newer LootLocker Unity SDK version is available, while also improving how the SDK version is resolved/stored in the editor.
Changes:
- Adjusts editor-time SDK version resolution in
LootLockerConfigand exposes an event/flag for “version resolved”. - Adds an Editor update checker with automatic (throttled) startup checks plus a manual menu item, including a small notification window.
- Adds Unity
.metaassets for the new Editor folder and script.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| Runtime/Game/Resources/LootLockerConfig.cs | Adds SDK-version-determined event/flag and changes when/how the version lookup is queued. |
| Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs | Implements GitHub Releases update check, throttling/silencing options, menu item, and notification window. |
| Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs.meta | Adds metadata for the new editor script. |
| Runtime/Editor/UpdateChecker.meta | Adds metadata for the new editor folder. |
Files not reviewed (2)
- Runtime/Editor/UpdateChecker.meta: Language not supported
- Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs.meta: Language not supported
…on after SDK updates Previously StoreSDKVersion() early-outed when sdk_version was already populated, meaning it would never update after an SDK upgrade on disk. Now it fires OnSdkVersionDetermined immediately with the cached value for responsiveness, then always re-queues Client.List() to get the fresh authoritative version. Also adds SdkVersionDetermined bool so InitializeOnLoad subscribers that register after the event has already fired can still act on it.
Adds LootLockerUpdateChecker ([InitializeOnLoad]) that: - Waits StartupDelaySeconds (60s) after editor load before checking, to avoid dialogs interrupting heavy project loads - Subscribes to LootLockerConfig.OnSdkVersionDetermined (or runs immediately if the version was already resolved before the delay) - Calls the GitHub Releases API at most once per 24h - Skips silently for UPM Registry installs (Package Manager handles it) - Shows a non-blocking EditorWindow with: Update Now, Skip This Version, Remind in 7 Days, Never Notify - Manual trigger always available at Window > LootLocker > Check for Updates Silence settings persisted in EditorPrefs per machine.
d368c80 to
0ad8026
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an automatic SDK update checker to the Unity Editor, notifying developers when a newer version is available on GitHub Releases. Targets users who installed via
.unitypackage,.tgz, or Git URL — UPM Registry installs are skipped since the Package Manager already handles update badges.Closes #1603.
Changes
Runtime/Game/Resources/LootLockerConfig.cs(bugfix)sdk_versionafter SDK upgrades on disk. PreviouslyStoreSDKVersion()early-outed whensdk_versionwas already populated, so the version was never refreshed after updating the SDK files. Now it firesOnSdkVersionDeterminedimmediately with the cached value for responsiveness, then always re-queuesClient.List()to get the fresh authoritative version.public static bool SdkVersionDeterminedso[InitializeOnLoad]subscribers that register after the event has already fired can still act on it without subscribing.public static event Action OnSdkVersionDetermined— raised once each time the SDK version is resolved.Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs(feature)[InitializeOnLoad]static classLootLockerUpdateCheckerwith:StartupDelaySeconds = 180.0, configurable in source) so the notification doesn't pop during heavy project loads.SdkVersionDeterminedand either runs immediately or subscribes toOnSdkVersionDetermined.EditorPrefs.PackageInfo.FindForAssembly— skips automatic check, shows an informational dialog on manual check.EditorPrefs(global per machine):[MenuItem("Window/LootLocker/Check for Updates")]— manual trigger that bypasses throttle and silence settings.LootLockerUpdateNotificationWindow— small non-blockingEditorWindowshowing installed vs. latest version with four action buttons.Looks
Testing
sdk_versionresolved.