-
-
Notifications
You must be signed in to change notification settings - Fork 44
fix: Restore green EditMode suite for schema and startup-hook guards #1962
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
Merged
Merged
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
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
25 changes: 17 additions & 8 deletions
25
Packages/src/Editor/FirstPartyTools/PausePoint/PausePointDomainReloadTracker.cs
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,21 +1,30 @@ | ||
| using System; | ||
|
|
||
| using UnityEditor; | ||
| using UnityEngine; | ||
|
|
||
| namespace io.github.hatayama.UnityCliLoop.FirstPartyTools | ||
| { | ||
| // [InitializeOnLoad] runs this type's static field initializers once per AppDomain load, so | ||
| // LoadedAtUtc marks this domain's birth. Used by physics-callback dispatch diagnostics to | ||
| // report how long the current domain has been alive without a reload -- a suspected factor in | ||
| // the existing-instance physics-dispatch miss (see docs/regression-harness.md). | ||
| [InitializeOnLoad] | ||
| // MarkDomainLoaded is invoked once per AppDomain load by the composition-root bootstrap | ||
| // (through FirstPartyToolsEditorStartup), so the recorded timestamp marks this domain's | ||
| // birth. Used by physics-callback dispatch diagnostics to report how long the current | ||
| // domain has been alive without a reload -- a suspected factor in the existing-instance | ||
| // physics-dispatch miss (see docs/regression-harness.md). | ||
| internal static class PausePointDomainReloadTracker | ||
| { | ||
| public static readonly DateTime LoadedAtUtc = DateTime.UtcNow; | ||
| private static DateTime? _loadedAtUtc; | ||
|
|
||
| public static void MarkDomainLoaded() | ||
| { | ||
| Debug.Assert(!_loadedAtUtc.HasValue, "MarkDomainLoaded must run once per domain load"); | ||
|
|
||
| _loadedAtUtc = DateTime.UtcNow; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| public static double SecondsSinceLoad() | ||
| { | ||
| return (DateTime.UtcNow - LoadedAtUtc).TotalSeconds; | ||
| Debug.Assert(_loadedAtUtc.HasValue, "MarkDomainLoaded must run before SecondsSinceLoad"); | ||
|
|
||
| return (DateTime.UtcNow - _loadedAtUtc.Value).TotalSeconds; | ||
| } | ||
| } | ||
| } | ||
12 changes: 12 additions & 0 deletions
12
Packages/src/Editor/FirstPartyTools/PausePoint/PausePointEditorStartup.cs
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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| namespace io.github.hatayama.UnityCliLoop.FirstPartyTools | ||
| { | ||
| // Keeps pause-point startup wiring inside the pause-point assembly so the composition | ||
| // root only depends on the bundled-tool facade. | ||
| internal static class PausePointEditorStartup | ||
| { | ||
| public static void Initialize() | ||
| { | ||
| PausePointDomainReloadTracker.MarkDomainLoaded(); | ||
| } | ||
| } | ||
| } |
11 changes: 11 additions & 0 deletions
11
Packages/src/Editor/FirstPartyTools/PausePoint/PausePointEditorStartup.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.