浏览代码

Simulation shutdown is no longer called when quitOnComplete is false

/main
Steven Leal 4 年前
当前提交
eba80c98
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 10
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs
  2. 1
      com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTagTests.cs
  3. 1
      com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTests.cs

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


}
// Wait for any final uploads before exiting quitting
if (m_WaitingForFinalUploads)
if (m_WaitingForFinalUploads && quitOnComplete)
Manager.Instance.Shutdown();
if (quitOnComplete)
UnityEditor.EditorApplication.ExitPlaymode();
UnityEditor.EditorApplication.ExitPlaymode();
Application.Quit();
Application.Quit();
#endif
return;
}

{
foreach (var randomizer in activeRandomizers)
randomizer.ScenarioComplete();
Manager.Instance.Shutdown();
DatasetCapture.ResetSimulation();
m_WaitingForFinalUploads = true;
return;

1
com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTagTests.cs


{
m_TestObject = new GameObject();
m_Scenario = m_TestObject.AddComponent<FixedLengthScenario>();
m_Scenario.quitOnComplete = false;
}
[TearDown]

1
com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTests.cs


public void OneRandomizerInstancePerTypeTest()
{
m_Scenario = m_TestObject.AddComponent<FixedLengthScenario>();
m_Scenario.quitOnComplete = false;
m_Scenario.CreateRandomizer<ExampleTransformRandomizer>();
Assert.Throws<ScenarioException>(() => m_Scenario.CreateRandomizer<ExampleTransformRandomizer>());
}

正在加载...
取消
保存