浏览代码

[Hotfix] Removed the reference to the brain in the OnEnable method of the agent to avoid errors when the agent is initialized without a brain

/hotfix-v0.9.2a
vincentpierre 6 年前
当前提交
60eed8f3
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 5
      unity-environment/Assets/ML-Agents/Scripts/Agent.cs

5
unity-environment/Assets/ML-Agents/Scripts/Agent.cs


void OnEnable()
{
textureArray = new Texture2D[agentParameters.agentCameras.Count];
for (int i = 0; i < brain.brainParameters.cameraResolutions.Length; i++)
for (int i = 0; i < agentParameters.agentCameras.Count; i++)
textureArray[i] = new Texture2D(brain.brainParameters.cameraResolutions[i].width,
brain.brainParameters.cameraResolutions[i].height, TextureFormat.RGB24, false);
textureArray[i] = new Texture2D(1, 1, TextureFormat.RGB24, false);
}
id = gameObject.GetInstanceID();
Academy academy = Object.FindObjectOfType<Academy>() as Academy;

正在加载...
取消
保存