浏览代码

Added editor compiler define to enable sampling in edit mode

/main
Steven Leal 4 年前
当前提交
fe9ea33f
共有 1 个文件被更改,包括 10 次插入16 次删除
  1. 26
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs

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


/// </summary>
public static ScenarioBase activeScenario
{
get => s_ActiveScenario;
get
{
#if UNITY_EDITOR
// This compiler define is required to allow samplers to
// iterate the scenario's random state in edit-mode
if (s_ActiveScenario == null)
s_ActiveScenario = FindObjectOfType<ScenarioBase>();
#endif
return s_ActiveScenario;
}
private set
{
if (value != null && s_ActiveScenario != null && value != s_ActiveScenario)

// Don't skip the first frame if executing on Unity Simulation
if (Configuration.Instance.IsSimulationRunningInCloud())
m_SkipFrame = false;
}
void OnEnable()
{
activeScenario = this;
}
void OnDisable()
{
s_ActiveScenario = null;
}
void Reset()
{
activeScenario = this;
}
void Start()

正在加载...
取消
保存