You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BehaviorParametersEditor's OnInspectorGUI() calls DisplayFailedModelChecks(), which then calls agent.InitializeSensors(). This causes the CreateSensors() code to be invoked on every OnInspectorGUI callback, even at runtime. The only way to stop repeated sensor instantiation is to hide the BehaviorParameters component inspector, so that its GUI is no longer updated.
To Reproduce
Open the FoodCollector example and place a Debug.Log in GridSensorComponent's CreateSensors() method. Select one of the agent gameobjects in the hierarchy and fold out its behavior parameters inspector settings. Enter play mode.
ML-Agents version: Release 18
Environment: FoodCollector
The text was updated successfully, but these errors were encountered:
if (Application.isPlaying)
{
var tracker = UnityEditor.ActiveEditorTracker.sharedTracker;
var editors = tracker.activeEditors;
for (int i = 0; i < editors.Length; i++)
{
// Can't check type because BehaviorParametersEditor is internal.
if (editors[i].ToString() == " (Unity.MLAgents.Editor.BehaviorParametersEditor)")
{
tracker.SetVisible(i, 0);
}
}
}
This issue has been automatically marked as stale because it has not had activity in the last 28 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.
stalebot
added
the
stale
Issues that have been idle for a while. Automatically closed by a bot if idle for too long.
label
Jan 9, 2022
This issue has been automatically closed because it has not had activity in the last 42 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.
BehaviorParametersEditor's OnInspectorGUI() calls DisplayFailedModelChecks(), which then calls agent.InitializeSensors(). This causes the CreateSensors() code to be invoked on every OnInspectorGUI callback, even at runtime. The only way to stop repeated sensor instantiation is to hide the BehaviorParameters component inspector, so that its GUI is no longer updated.
To Reproduce
Open the FoodCollector example and place a Debug.Log in GridSensorComponent's CreateSensors() method. Select one of the agent gameobjects in the hierarchy and fold out its behavior parameters inspector settings. Enter play mode.
The text was updated successfully, but these errors were encountered: