Skip to content

Commit

Permalink
Fixes double action finish calls, change modern action type
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroHG committed Aug 14, 2024
1 parent 40fbd13 commit 4246209
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 312 deletions.
12 changes: 6 additions & 6 deletions unity/Assets/Scripts/AgentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public void updateThirdPartyCameraImageSynthesis(bool status) {
}
}

private void updateCameraProperties(
private ActionFinished updateCameraProperties(
Camera camera,
Vector3? position,
Vector3? rotation,
Expand Down Expand Up @@ -693,7 +693,7 @@ private void updateCameraProperties(
imageSynthesis.OnCameraChange();
}

this.activeAgent().actionFinished(success: true);
return ActionFinished.Success;
}

private void assertFovInBounds(float fov) {
Expand Down Expand Up @@ -821,7 +821,7 @@ public OptionalVector3(float? x = null, float? y = null, float? z = null) {

//allows repositioning and changing of values of agent's primary camera
//note this does not support changing the main camera of multiple agents beyond the primary for now
public void UpdateMainCamera(
public ActionFinished UpdateMainCamera(
OptionalVector3 position = null,
OptionalVector3 rotation = null,
float? fieldOfView = null,
Expand Down Expand Up @@ -855,7 +855,7 @@ public void UpdateMainCamera(
optionalVector3: rotation,
defaultsOnNull: oldRotation
);
updateCameraProperties(
return updateCameraProperties(
camera: agentMainCam,
position: targetPosition,
rotation: targetRotation,
Expand All @@ -873,7 +873,7 @@ public void UpdateMainCamera(
}

// Updates third party cameras, including secondary camera of stretch agent
public void UpdateThirdPartyCamera(
public ActionFinished UpdateThirdPartyCamera(
int thirdPartyCameraId = 0,
OptionalVector3 position = null,
OptionalVector3 rotation = null,
Expand Down Expand Up @@ -922,7 +922,7 @@ public void UpdateThirdPartyCamera(
optionalVector3: rotation,
defaultsOnNull: oldRotation
);
updateCameraProperties(
return updateCameraProperties(
camera: thirdPartyCamera,
position: targetPosition,
rotation: targetRotation,
Expand Down
Loading

0 comments on commit 4246209

Please sign in to comment.