-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Hotfix 0.4.0b #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix 0.4.0b #1002
Changes from all commits
8371b96
c6ea212
93fea2e
2b699d6
a1a7245
9b478c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,10 +257,9 @@ public abstract class Agent : MonoBehaviour | |
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason behind this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The agent can be initialized without a brain attached, in which case the old code would throw an error. In the new code we use the agent's camera list to initialize the texture2d array. But, since we don't know how big the textures should be, we initialize them to 1x1 to start with. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we want to allow the agent be initialized without a brain attached? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may want to programmatically attach brains during runtime, as is the case with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see. |
||
} | ||
id = gameObject.GetInstanceID(); | ||
Academy academy = Object.FindObjectOfType<Academy>() as Academy; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the fix for the bug preventing using environments with python multi-processing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. In the old code they were global variables, which prevented multiple instances of them from being created correctly.