浏览代码

Merge pull request #996 from Unity-Technologies/hotfix-no-brain-initialization

[Hotfix] Removed the reference to the brain in the OnEnable method of…
/hotfix-v0.9.2a
GitHub 6 年前
当前提交
64de28cc
共有 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;

正在加载...
取消
保存