diff --git a/unity/Assets/Scripts/AgentManager.cs b/unity/Assets/Scripts/AgentManager.cs index f4163ac819..c59cec89b9 100644 --- a/unity/Assets/Scripts/AgentManager.cs +++ b/unity/Assets/Scripts/AgentManager.cs @@ -352,6 +352,13 @@ public void Initialize(ServerAction action) { action.alwaysReturnVisibleRange; } + //deprecation check for visibilityScheme + if(action.visibilityScheme != VisibilityScheme.Distance.ToString()) { + throw new ArgumentException( + $"Invalid visibilityScheme {action.visibilityScheme}. Must be 'Distance'." + ); + } + //if multi agent requested, add duplicates of primary agent now addAgents(action); this.agents[0].m_Camera.depth = 9999; @@ -2687,7 +2694,7 @@ public static VisibilityScheme GetVisibilitySchemeFromString(string visibilitySc catch (ArgumentException ex) { #pragma warning restore 0168 Debug.LogError( - "Error parsing visibilityScheme: '" + visibilityScheme + "' defaulting to Collider" + "Error parsing visibilityScheme: '" + visibilityScheme + "' defaulting to Distance Based" ); } diff --git a/unity/Assets/Scripts/BaseFPSAgentController.cs b/unity/Assets/Scripts/BaseFPSAgentController.cs index ae6617f01a..a9090d501f 100644 --- a/unity/Assets/Scripts/BaseFPSAgentController.cs +++ b/unity/Assets/Scripts/BaseFPSAgentController.cs @@ -4560,11 +4560,12 @@ public void GetVisibleObjectsFromCamera( Camera camera = m_Camera; if (thirdPartyCameraId.HasValue) { camera = agentManager.thirdPartyCameras[thirdPartyCameraId.Value]; - if (this.visibilityScheme != VisibilityScheme.Distance) { - throw new System.NotImplementedException( - $"Visibility scheme {this.visibilityScheme} is not implemented for third party cameras. Default visibility scheme should be 'Distance'." - ); - } + } + + if (this.visibilityScheme != VisibilityScheme.Distance) { + throw new System.NotImplementedException( + $"Visibility scheme {this.visibilityScheme} is not compatible. Visibility scheme should be 'Distance'." + ); } //only check visibility for objects with these ids otherwise check them all @@ -4614,17 +4615,18 @@ public void GetVisibleObjects( Camera camera; //which camera are we checking visibility from? if (thirdPartyCameraIndex.HasValue) { camera = agentManager.thirdPartyCameras[thirdPartyCameraIndex.Value]; - if (this.visibilityScheme != VisibilityScheme.Distance) { - throw new System.NotImplementedException( - $"Visibility scheme {this.visibilityScheme} is not implemented for third party cameras. Default visibility scheme should be 'Distance'." - ); - } } //can also be used to query main camera else { camera = m_Camera; } + if (this.visibilityScheme != VisibilityScheme.Distance) { + throw new System.NotImplementedException( + $"Visibility scheme {this.visibilityScheme} is not compatible. Visibility scheme should be 'Distance'." + ); + } + List filterSimObjs = null; if (objectIds != null) { foreach (string objectId in objectIds) {