浏览代码

null check for m_SpawnedObjects

For some reason, m_SpawnedObjects is still null when the first iteration starts, even though it is initialized. This is only happening for one of us, but it is happening consistently. Adding this null-check is a necessary fail-safe for now.
/main
Steven Leal 4 年前
当前提交
4d5fc8e2
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/BackgroundObjectPlacementRandomizer.cs
  2. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/ForegroundObjectPlacementRandomizer.cs

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/BackgroundObjectPlacementRandomizer.cs


/// </summary>
protected override void OnIterationStart()
{
if (m_SpawnedObjects == null)
m_SpawnedObjects = new List<GameObject>();
for (var i = 0; i < layerCount; i++)
{
var seed = scenario.GenerateIterativeRandomSeed(i);

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/ForegroundObjectPlacementRandomizer.cs


/// </summary>
protected override void OnIterationStart()
{
if (m_SpawnedObjects == null)
m_SpawnedObjects = new List<GameObject>();
var seed = scenario.GenerateRandomSeed();
var placementSamples = PoissonDiskSampling.GenerateSamples(
placementArea.x, placementArea.y, separationDistance, seed);

正在加载...
取消
保存