From 216f00ae1d540b760f2fe9973beaf8c5d33da038 Mon Sep 17 00:00:00 2001 From: Eric Kolve Date: Mon, 14 Feb 2022 15:38:58 -0800 Subject: [PATCH] moving JavascriptInterface.enabled = true into AgentManager from DebugInputField --- unity/Assets/Scripts/AgentManager.cs | 4 ++++ unity/Assets/Scripts/DebugInputField.cs | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/unity/Assets/Scripts/AgentManager.cs b/unity/Assets/Scripts/AgentManager.cs index 67bc1586ed..90248d6d15 100644 --- a/unity/Assets/Scripts/AgentManager.cs +++ b/unity/Assets/Scripts/AgentManager.cs @@ -130,6 +130,10 @@ void Start() { #if UNITY_WEBGL physicsSceneManager.UnpausePhysicsAutoSim(); primaryAgent.InitializeBody(); + JavaScriptInterface jsInterface = primaryAgent.GetComponent(); + if (jsInterface != null) { + jsInterface.enabled = true; + } #endif StartCoroutine(EmitFrame()); diff --git a/unity/Assets/Scripts/DebugInputField.cs b/unity/Assets/Scripts/DebugInputField.cs index 748458cb3d..7d47eb8e19 100644 --- a/unity/Assets/Scripts/DebugInputField.cs +++ b/unity/Assets/Scripts/DebugInputField.cs @@ -132,7 +132,6 @@ void SelectPlayerControl() { #if UNITY_WEBGL Debug.Log("Player Control Set To:Webgl"); setControlMode(ControlMode.FPS); - CurrentActiveController().GetComponent().enabled = true; #endif #if CROWDSOURCE_TASK Debug.Log("CROWDSOURCE_TASK");