Skip to content

Commit

Permalink
Add set dirty flag when change state
Browse files Browse the repository at this point in the history
  • Loading branch information
nowsprinting committed Nov 26, 2024
1 parent ff30a5d commit ca62a97
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Editor/UI/Settings/AutopilotSettingsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ internal void Launch()
{
state.launchFrom = LaunchType.EditMode;
#if UNITY_2020_3_OR_NEWER
EditorUtility.SetDirty(state);
AssetDatabase.SaveAssetIfDirty(state); // Note: Sync with virtual players of MPPM package
#endif
EditorApplication.isPlaying = true;
Expand Down
1 change: 1 addition & 0 deletions Runtime/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ internal static async UniTaskVoid TeardownLaunchAutopilotAsync(AutopilotState st
state.settings = null;
state.exitCode = exitCode;
#if UNITY_EDITOR && UNITY_2020_3_OR_NEWER
EditorUtility.SetDirty(state);
AssetDatabase.SaveAssetIfDirty(state); // Note: Sync with virtual players of MPPM package
#endif

Expand Down
1 change: 1 addition & 0 deletions Runtime/Settings/AutopilotState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void Reset()
settings = null;
exitCode = ExitCode.Normally;
#if UNITY_EDITOR && UNITY_2020_3_OR_NEWER
EditorUtility.SetDirty(this);
AssetDatabase.SaveAssetIfDirty(this); // Note: Sync with virtual players of MPPM package
#endif
}
Expand Down

0 comments on commit ca62a97

Please sign in to comment.