浏览代码

Fix bug in BrainParameter Drawer (#4752)

* clone when copy branch size array
/MLA-1734-demo-provider
GitHub 4 年前
当前提交
1daf60ee
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      com.unity.ml-agents/Runtime/Policies/BrainParameters.cs

4
com.unity.ml-agents/Runtime/Policies/BrainParameters.cs


if (VectorActionSpaceType == SpaceType.Discrete)
{
m_ActionSpec.NumContinuousActions = 0;
m_ActionSpec.BranchSizes = VectorActionSize;
m_ActionSpec.BranchSizes = (int[])VectorActionSize.Clone();
}
hasUpgradedBrainParametersWithActionSpec = true;

{
if (m_ActionSpec.NumContinuousActions == 0)
{
VectorActionSize = ActionSpec.BranchSizes;
VectorActionSize = (int[])ActionSpec.BranchSizes.Clone();
VectorActionSpaceType = SpaceType.Discrete;
}
else if (m_ActionSpec.NumDiscreteActions == 0)

正在加载...
取消
保存