Publisher SDK improvements#475
Open
kirre-bylund wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Unity SDK’s suitability for publisher/white-label distributions by (1) introducing an editor tooling enable/disable switch, (2) centralizing editor UI branding around LootLockerConfig.PackageName, and (3) strengthening external file config behavior to be treated as the governing configuration source.
Changes:
- Added
enableEditorAdminExtension/enable_editor_admin_extensionconfig setting (ScriptableObject, external file config, and command-line override). - Replaced hardcoded “LootLocker” labels/paths in editor tooling with
LootLockerConfig.PackageNameto support rebranding. - Refactored external file config application (
ApplyFileConfig) and introducedIsFileConfigActiveto support “file config controls settings” UX.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Runtime/Game/Resources/LootLockerExternalFileConfig.cs | Adds enable_editor_admin_extension to the external config model. |
| Runtime/Game/Resources/LootLockerConfig.cs | Adds enableEditorAdminExtension, caches file config, adds IsFileConfigActive, and refactors file-config application. |
| Runtime/Game/LootLockerLogger.cs | Uses LootLockerConfig.PackageName in version log output for white-label branding. |
| Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs | Updates menu path and dialogs/titles to use PackageName; adjusts notification window UI. |
| Runtime/Editor/ProjectSettings.cs | Adds “powered by LootLocker” notice, disables UI under file config, and rebrands settings path/label. |
| Runtime/Editor/LootLockerEditorData.cs | Suppresses first-time auto-show when editor admin extension is disabled. |
| Runtime/Editor/LogViewer/LootLockerLogViewerWindow.cs | Rebrands menu path and window title using PackageName. |
| Runtime/Editor/Editor UI/LootLockerAdminExtension.cs | Rebrands menu paths/window titles using PackageName; adds validation to gray out some menu items when disabled. |
Comments suppressed due to low confidence (1)
Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs:83
- The update-checker menu item (and the automatic periodic check) is not gated by
enableEditorAdminExtension, so it won't be greyed out / skipped when the editor admin extension is disabled via config.
[MenuItem("Window/" + LootLockerConfig.PackageName + "/Check for Updates", false, 102)]
public static void ManualCheck()
{
FetchLatestRelease(isManualCheck: true);
}
Comment on lines
+429
to
+435
| else if (args[i] == "-enableeditoradminextension") | ||
| { | ||
| if (bool.TryParse(args[i + 1], out bool enableEditorAdminExtension)) | ||
| { | ||
| this.enableEditorAdminExtension = enableEditorAdminExtension; | ||
| } | ||
| } |
Comment on lines
+734
to
+737
| _current.enableEditorAdminExtension = fileConfig.enable_editor_admin_extension; | ||
| #if UNITY_EDITOR | ||
| _current.adminToken = null; | ||
| #endif |
Comment on lines
+15
to
21
| [MenuItem("Window/" + LootLockerConfig.PackageName + "/Log Viewer")] | ||
| public static void ShowWindow() | ||
| { | ||
| var wnd = GetWindow<LootLockerLogViewerWindow>(); | ||
| wnd.titleContent = new GUIContent("LootLocker Log Viewer"); | ||
| wnd.titleContent = new GUIContent(LootLockerConfig.PackageName + " Log Viewer"); | ||
| wnd.Show(); | ||
| } |
Comment on lines
261
to
268
| [SettingsProvider] | ||
| public static SettingsProvider CreateProvider() | ||
| { | ||
| return new ProjectSettings("Project/LootLocker SDK", SettingsScope.Project) | ||
| return new ProjectSettings("Project/" + LootLockerConfig.PackageName + " SDK", SettingsScope.Project) | ||
| { | ||
| label = "LootLocker SDK" | ||
| label = LootLockerConfig.PackageName + " SDK" | ||
| }; | ||
| } |
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
Solves https://github.com/lootlocker/index/issues/1598 for Unity (Unreal implementations to come)
Three related improvements to support white-label / publisher SDK distributions and improve config reliability.
Changes
1. Add
enableEditorAdminExtensionconfig settingA new boolean config field (default
true) that controls whether the LootLocker editor tooling is available at all. When set tofalse:Supported via all existing config paths: ScriptableObject inspector, external file config (
enable_editor_admin_extension), and command-line override (-enableeditoradminextension).2. White-label support — editor UI uses
PackageNamePackageNamewas changed fromprivate static readonly stringtopublic const string. All hardcoded"LootLocker"labels in editor tooling now reference this constant, so a publisher only needs to change the one constant to rebrand the entire editor experience:[MenuItem]paths (Window/LootLocker/...→Window/[PackageName]/...)Where the renamed SDK links back to LootLocker resources (GitHub releases page, Project Settings), a contextual notice is shown: "[Name] SDK is powered by LootLocker — ...". This appears in:
A sample plain-JSON external config file is included at
Resources/SamplePublisherConfig.bytes.3. External file config as absolute source of truth
Previously the file config (
.bytes) was applied once to the ScriptableObject on load, but subsequent mutations to the asset (e.g. via the Inspector) would silently win until the next domain reload.Now, when a file config is present it is the authoritative source on every
Get()call:_activeFileConfigis cached on first load alongside_currentGet()re-applies all file config values before returningApplyFileConfig()extracted as a shared helper (removes duplication)IsFileConfigActivepublic property added for other systems to queryOnEnterPlaymodeInEditorresets_activeFileConfigso the file is re-parsed cleanly on playIsFileConfigActiveistrue, all fields are wrapped inEditorGUI.BeginDisabledGroup(true)and a warning box is shown: "Settings are controlled by the external config file and cannot be edited here."Testing
PackageNameto a non-"LootLocker"value and confirm all menu items, window titles, and dialogs reflect the new nameenableEditorAdminExtension = falseand confirm all editor menu items are greyed out / Project Settings entry disappears.bytesfile config into the Resources/Config folder, open Project Settings and confirm all fields are greyed out and the warning box is shown; mutate the ScriptableObject in the Inspector and confirm the mutation is overwritten on the nextGet()call