Skip to content

Commit af3cc10

Browse files
miguelalonsojrGitHub Enterprise
authored andcommitted
Set execution order to be negative to make sure scripts run before de… (#26)
* Set execution order to be negative to make sure scripts run before default time. * Fixed issue with the basic environment. Updated submodule. * Removed execution order class attribute from project settings overrides and added it to basic controller. * Updated submodule. Added platform #if to BasicController awake. * Removed execution order from basic controller. Added execution order to project settings through editor. * Updated submodule.
1 parent 56faf4e commit af3cc10

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

Project/Assets/ML-Agents/Examples/Basic/Scripts/BasicController.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using UnityEngine;
23
using UnityEngine.SceneManagement;
34
using Unity.MLAgents;
@@ -25,6 +26,19 @@ public class BasicController : MonoBehaviour
2526

2627
Agent m_Agent;
2728

29+
public void Awake()
30+
{
31+
// Since this example does not inherit from the Agent class, explicit registration
32+
// of the RpcCommunicator is required. The RPCCommunicator should only be compiled
33+
// for Standalone platforms (i.e. Windows, Linux, or Mac)
34+
#if UNITY_EDITOR || UNITY_STANDALONE
35+
if (!CommunicatorFactory.CommunicatorRegistered)
36+
{
37+
Debug.Log("Registered Communicator.");
38+
CommunicatorFactory.Register<ICommunicator>(RpcCommunicator.Create);
39+
}
40+
#endif
41+
}
2842

2943
public void OnEnable()
3044
{

Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace Unity.MLAgentsExamples
99
/// This can modify some Physics and time-stepping properties, so you
1010
/// shouldn't copy it into your project unless you know what you're doing.
1111
/// </summary>
12-
[DefaultExecutionOrder(4)]
1312
public class ProjectSettingsOverrides : MonoBehaviour
1413
{
1514
// Original values

Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Project/ProjectSettings/UnityConnectSettings.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ UnityConnectSettings:
99
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
1010
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
1111
m_ConfigUrl: https://config.uca.cloud.unity3d.com
12+
m_DashboardUrl: https://dashboard.unity3d.com
1213
m_TestInitMode: 0
1314
CrashReportingSettings:
1415
m_EventUrl: https://perf-events.cloud.unity3d.com

0 commit comments

Comments
 (0)