Skip to content

Commit

Permalink
Merge pull request #114 from nowsprinting/fix/unity2019
Browse files Browse the repository at this point in the history
Fix to support Unity 2020.2 or older
  • Loading branch information
bo40 authored Nov 21, 2024
2 parents df6c795 + 05b6338 commit 3018607
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
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

0 comments on commit 3018607

Please sign in to comment.