Skip to content

Commit

Permalink
Update TestThirdPartyCameraAndMainCamera.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
winthos committed Aug 9, 2024
1 parent 5c23fc6 commit e68cc2d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions unity/Assets/UnitTests/TestThirdPartyCameraAndMainCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,49 @@ public IEnumerator TestUpdateThirdPartyCamera()
Assert.AreEqual(result, true);
}

[UnityTest]
public IEnumerator TestGetVisibleObjects()
{
Dictionary<string, object> action = new Dictionary<string, object>();

action["action"] = "Initialize";
action["fieldOfView"] = 90f;
action["snapToGrid"] = true;
yield return step(action);

action.Clear();

action["action"] = "AddThirdPartyCamera";
action["position"] = new Vector3(-0.67f, 1.315f, 0.46f);
action["rotation"] = new Vector3(0, 180, 0);
action["orthographic"] = true;
action["orthographicSize"] = 5;
action["parent"] = "world";
action["agentPositionRelativeCoordinates"] = false;
yield return step(action);

action.Clear();

action["action"] = "GetVisibleObjects";
action["thirdPartyCameraIndex"] = 0;
action["visibilityScheme"] = "Distance";
yield return step(action);

//Debug.Log($"action return: {actionReturn}");
List<string> visibleObjects = (List<string>) actionReturn;

//check for expected object at first few elements
//also check for total count of visible objects to be the expected amount
foreach(string obj in visibleObjects)
{
Debug.Log(obj);
}

//test with objectId filter now


}

[UnityTest]
public IEnumerator TestUpdateMainCamera()
{
Expand Down

0 comments on commit e68cc2d

Please sign in to comment.