浏览代码

fix create default sensor

/develop/custom-raycast
Ruo-Ping Dong 4 年前
当前提交
833703d3
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensor.cs

4
com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensor.cs


/// </summary>
public virtual int GetObservationSizePerRay()
{
return RayPerceptionInput.DetectableTags.Count + 2;
return (RayPerceptionInput.DetectableTags?.Count ?? 0) + 2;
}
/// <summary>

public int GetNumberOfRays()
{
return RayPerceptionInput.Angles.Count;
return RayPerceptionInput.Angles?.Count ?? 0;
}
void SetNumObservations(int observationsSizePerRay, int numRays)

正在加载...
取消
保存