Skip to content
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

Fix to support Unity 2020.2 or older #114

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Editor/UI/Settings/AutopilotSettingsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ internal void Launch()
else
{
state.launchFrom = LaunchType.EditMode;
#if UNITY_2020_3_OR_NEWER
AssetDatabase.SaveAssetIfDirty(state); // Note: Sync with virtual players of MPPM package
#endif
EditorApplication.isPlaying = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ internal static async UniTaskVoid TeardownLaunchAutopilotAsync(AutopilotState st
{
state.settings = null;
state.exitCode = exitCode;
#if UNITY_EDITOR
#if UNITY_EDITOR && UNITY_2020_3_OR_NEWER
AssetDatabase.SaveAssetIfDirty(state); // Note: Sync with virtual players of MPPM package
#endif

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Settings/AutopilotSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private static void Initialize()
settings.ConvertSceneCrossingAgentsFromObsoleteObserverAgent(logger); // Note: before convert other Agents.
settings.ConvertErrorHandlerAgentFromObsoleteSettings(logger);

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