Skip to content

Feat: Add "Check for updates" functionality to the SDK#474

Merged
kirre-bylund merged 4 commits into
devfrom
feat/1603-update-check
Jun 9, 2026
Merged

Feat: Add "Check for updates" functionality to the SDK#474
kirre-bylund merged 4 commits into
devfrom
feat/1603-update-check

Conversation

@kirre-bylund

Copy link
Copy Markdown
Contributor

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)

  • Fixes stale sdk_version after SDK upgrades on disk. Previously StoreSDKVersion() early-outed when sdk_version was already populated, so the version was never refreshed after updating the SDK files. Now it fires OnSdkVersionDetermined immediately with the cached value for responsiveness, then always re-queues Client.List() to get the fresh authoritative version.
  • Adds public static bool SdkVersionDetermined so [InitializeOnLoad] subscribers that register after the event has already fired can still act on it without subscribing.
  • Adds public static event Action OnSdkVersionDetermined — raised once each time the SDK version is resolved.

Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs (feature)

  • [InitializeOnLoad] static class LootLockerUpdateChecker with:
    • Startup delay (StartupDelaySeconds = 180.0, configurable in source) so the notification doesn't pop during heavy project loads.
    • After the delay: checks SdkVersionDetermined and either runs immediately or subscribes to OnSdkVersionDetermined.
    • 24 h throttle — at most one automatic check per day, stamped in EditorPrefs.
    • UPM Registry detection via PackageInfo.FindForAssembly — skips automatic check, shows an informational dialog on manual check.
    • Silence options persisted in EditorPrefs (global per machine):
      • Skip This Version
      • Remind in 7 Days
      • Never Notify
  • [MenuItem("Window/LootLocker/Check for Updates")] — manual trigger that bypasses throttle and silence settings.
  • LootLockerUpdateNotificationWindow — small non-blocking EditorWindow showing installed vs. latest version with four action buttons.
  • Version comparison is numeric major.minor.patch (not lexicographic).

Looks

image image

Testing

  • Confirmed automatic check fires after startup delay with correct sdk_version resolved.
  • Confirmed 24 h throttle suppresses duplicate checks within the same day.
  • Confirmed manual check works regardless of throttle/silence state.
  • UPM Registry install correctly skips auto-check.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LootLockerConfig and 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 .meta assets 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

Comment thread Runtime/Game/Resources/LootLockerConfig.cs Outdated
Comment thread Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs Outdated
Comment thread Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs
Comment thread Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs
Comment thread Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs
Comment thread Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs.meta Outdated
Base automatically changed from feat/1574-connection-state-check to dev June 9, 2026 10:14
…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.
@kirre-bylund kirre-bylund force-pushed the feat/1603-update-check branch from d368c80 to 0ad8026 Compare June 9, 2026 10:15
@kirre-bylund kirre-bylund merged commit 7829137 into dev Jun 9, 2026
69 of 70 checks passed
@kirre-bylund kirre-bylund deleted the feat/1603-update-check branch June 9, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants