Skip to content

Commit

Permalink
Merge pull request #127 from nowsprinting/chore/fix_warnings
Browse files Browse the repository at this point in the history
Fix compilation warnings
  • Loading branch information
bo40 authored Dec 2, 2024
2 parents e127099 + d6d6660 commit 4f30811
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
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}

0 comments on commit 4f30811

Please sign in to comment.