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 compilation warnings #127

Merged
merged 2 commits into from
Dec 2, 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
5 changes: 5 additions & 0 deletions Runtime/AgentInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class AgentInspector : MonoBehaviour
/// Returns the running Agent instance array.
/// No caching.
/// </summary>
#if UNITY_2022_3_OR_NEWER
public static AgentInspector[] Instances => FindObjectsByType<AgentInspector>(FindObjectsSortMode.None);
// Note: Supported in Unity 2020.3.4, 2021.3.18, 2022.2.5 or later.
#else
public static AgentInspector[] Instances => FindObjectsOfType<AgentInspector>();
#endif
}
}
5 changes: 5 additions & 0 deletions Runtime/Autopilot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ public static Autopilot Instance
{
get
{
#if UNITY_2022_3_OR_NEWER
var autopilot = FindAnyObjectByType<Autopilot>();
// Note: Supported in Unity 2020.3.4, 2021.3.18, 2022.2.5 or later.
#else
var autopilot = FindObjectOfType<Autopilot>();
#endif
if (autopilot == null)
{
throw new InvalidOperationException("Autopilot instance not found");
Expand Down
1 change: 0 additions & 1 deletion Tests/Runtime/Agents/UGUIPlaybackAgentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public async Task Run_WithAssetFile()
#endif
agent.Logger = Debug.unityLogger;
agent.Random = new RandomFactory(0).CreateRandom();
agent.name = TestContext.CurrentContext.Test.Name;

using (var cancellationTokenSource = new CancellationTokenSource())
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestAssets/PlaybackAgent.asset
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d429d6926ea8c4f688c2bfed7e53d7cf, type: 3}
m_Name: Run_WithAssetFile
m_Name: PlaybackAgent
m_EditorClassIdentifier:
description:
recordedJson: {fileID: 4900000, guid: 7847549ddc204e628dbc7746afd8f03f, type: 3}