-
Notifications
You must be signed in to change notification settings - Fork 0
Сделать Sidecar UV2 replay локальным (EditorPrefs, по умолчанию выключено) #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,23 @@ | ||
| // PostprocessorDefineManager.cs — sidecar replay toggle. | ||
| // Storage now lives in MeshLabProjectSettings (per-project, committed). | ||
| // Storage is a per-user opt-in so an untrusted project cannot enable replay. | ||
| // This class is kept as a thin shim so existing call sites don't need changes. | ||
|
|
||
| using UnityEditor; | ||
|
|
||
| namespace SashaRX.UnityMeshLab | ||
| { | ||
| static class PostprocessorDefineManager | ||
| { | ||
| const string PrefKey = "LightmapUvTool.SidecarUv2Mode"; | ||
|
|
||
| internal static bool IsEnabled() | ||
| { | ||
| return MeshLabProjectSettings.Instance.sidecarMode; | ||
| return EditorPrefs.GetBool(PrefKey, false); | ||
| } | ||
|
|
||
| internal static void SetEnabled(bool enabled) | ||
| { | ||
| MeshLabProjectSettings.Instance.sidecarMode = enabled; | ||
| MeshLabProjectSettings.Save(); | ||
| EditorPrefs.SetBool(PrefKey, enabled); | ||
| } | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: SashaRX/UnityMeshLab
Length of output: 10399
🌐 Web query:
Unity EditorPrefs stores preferences per user machine project scope documentation💡 Result:
In Unity, the EditorPrefs class is used to store and access user-specific Editor preferences that are scoped to the local machine, not to a specific project [1][2][3]. Key characteristics of EditorPrefs include: Scope and Persistence: - Machine Scope: EditorPrefs store settings that persist across all projects on a specific local machine [2][4]. They are not saved within the project folder or shared via version control [2][4]. - Storage Location: On Windows, these are stored in the registry under HKEY_CURRENT_USER\Software\Unity Technologies\Unity Editor 5.x [1][3]. On macOS, they are stored in a.plist file in ~/Library/Preferences/ [1][3]. On Linux, they are stored in ~/.local/share/unity3d/prefs [1][3]. Distinction from Project Settings: - While EditorPrefs are personal, machine-level settings, Project Settings are intended for settings that are shared across a team [2][4]. Project Settings are stored within the project's folder structure (typically in the ProjectSettings directory) and are intended to be tracked by version control systems [2][5][4]. Implementing Project-Specific Preferences: - Because EditorPrefs are machine-wide by default, they do not inherently support project-scoped storage [6][7]. To associate EditorPrefs with a specific project, developers often manually prepend a project-specific identifier (such as a hash of the project's path or a unique project ID) to the preference key [6][7]. Alternatively, for project-scoped settings, developers typically use files stored within the project’s Assets or ProjectSettings folders (such as ScriptableObjects or JSON files), or utilize the Settings Manager package to handle project-specific repositories [5][7][8].
Citations:
🏁 Script executed:
Repository: SashaRX/UnityMeshLab
Length of output: 339
Уточните область действия сброса.
PostprocessorDefineManager.SetEnabled(false)записывает пользовательскийEditorPrefs. Поэтому сброс в одном проекте отключает Sidecar Mode в других проектах того же пользователя на этой машине. Обновите подсказку и диалог, чтобы явно указать эту область действия.🤖 Prompt for AI Agents