Skip to content

Commit

Permalink
Merge pull request #982 from allenai/erick/jsinterface-enable
Browse files Browse the repository at this point in the history
Enable JavascriptInterface within AgentManager
  • Loading branch information
Eric Kolve authored Mar 23, 2022
2 parents bac38b9 + 216f00a commit f8a3f78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions unity/Assets/Scripts/AgentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ void Start() {
#if UNITY_WEBGL
physicsSceneManager.UnpausePhysicsAutoSim();
primaryAgent.InitializeBody();
JavaScriptInterface jsInterface = primaryAgent.GetComponent<JavaScriptInterface>();
if (jsInterface != null) {
jsInterface.enabled = true;
}
#endif

StartCoroutine(EmitFrame());
Expand Down
1 change: 0 additions & 1 deletion unity/Assets/Scripts/DebugInputField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ void SelectPlayerControl() {
#if UNITY_WEBGL
Debug.Log("Player Control Set To:Webgl");
setControlMode(ControlMode.FPS);
CurrentActiveController().GetComponent<JavaScriptInterface>().enabled = true;
#endif
#if CROWDSOURCE_TASK
Debug.Log("CROWDSOURCE_TASK");
Expand Down

0 comments on commit f8a3f78

Please sign in to comment.