浏览代码

Hacking in support for editor scene generation

/scene_gen
Jon Hogins 3 年前
当前提交
899b4cca
共有 2 个文件被更改,包括 21 次插入0 次删除
  1. 8
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTagManager.cs
  2. 13
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs

8
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTagManager.cs


using System;
using System.Collections.Generic;
using UnityEditor;
namespace UnityEngine.Perception.Randomization.Randomizers
{

/// <returns>RandomizerTags of the given type</returns>
public IEnumerable<T> Query<T>(bool returnSubclasses = false) where T : RandomizerTag
{
#if UNITY_EDITOR
if (!EditorApplication.isPlaying)
{
foreach (var o in Object.FindObjectsOfType<T>())
yield return o;
}
#endif
var queriedTagType = typeof(T);
if (!m_TagMap.ContainsKey(queriedTagType))
yield break;

13
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs


$"Invalid state {state} encountered while updating scenario");
}
}
public void DoIteration()
{
activeScenario = this;
OnStart();
foreach (var randomizer in activeRandomizers)
randomizer.ScenarioStart();
foreach (var randomizer in activeRandomizers)
{
randomizer.IterationStart();
}
}
#endregion
void IterationLoop()

正在加载...
取消
保存