Skip to content

Commit

Permalink
Merge branch 'main' into stretch-camera-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
winthos committed Aug 21, 2024
2 parents 9853797 + b648af0 commit 7bd5a59
Show file tree
Hide file tree
Showing 6 changed files with 320 additions and 571 deletions.
17 changes: 13 additions & 4 deletions unity/Assets/Scripts/AgentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2628,7 +2635,7 @@ public class ServerAction {
// default time for objects to wait before returning actionFinished() if an action put them in motion
public float TimeToWaitForObjectsToComeToRest = 10.0f;
public float scale;
public string visibilityScheme = VisibilityScheme.Collider.ToString();
public string visibilityScheme = VisibilityScheme.Distance.ToString();
public bool fastActionEmit = true;

// this allows us to chain the dispatch between two separate
Expand Down Expand Up @@ -2678,7 +2685,7 @@ public SimObjType ReceptableSimObjType() {
}

public static VisibilityScheme GetVisibilitySchemeFromString(string visibilityScheme) {
VisibilityScheme result = VisibilityScheme.Collider;
VisibilityScheme result = VisibilityScheme.Distance;
try {
result = (VisibilityScheme)Enum.Parse(typeof(VisibilityScheme), visibilityScheme, true);
}
Expand All @@ -2687,7 +2694,9 @@ 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"
);
}

Expand Down Expand Up @@ -2788,7 +2797,7 @@ public enum ServerActionErrorCode {
}

public enum VisibilityScheme {
Collider,
Collider, //deprecated, scheme is now Distance based only
Distance
}

Expand Down
Loading

0 comments on commit 7bd5a59

Please sign in to comment.