浏览代码

Switching RunInUnitySimulationWindow to use player build settings for scene list

/generic-asset-sources
Jon Hogins 4 年前
当前提交
310fb4f0
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 10
      com.unity.perception/Editor/Randomization/Editors/RunInUnitySimulationWindow.cs

10
com.unity.perception/Editor/Randomization/Editors/RunInUnitySimulationWindow.cs


throw new NotSupportedException("Invalid instance count specified");
if (m_RunParameters.totalIterations <= 0)
throw new NotSupportedException("Invalid total iteration count specified");
if (string.IsNullOrEmpty(m_RunParameters.currentOpenScenePath))
throw new MissingFieldException("Invalid scene path");
if (m_RunParameters.currentScenario == null)
throw new MissingFieldException(
"There is not a Unity Simulation compatible scenario present in the scene");

var projectBuildDirectory = $"{m_BuildDirectory}/{m_RunParameters.runName}";
if (!Directory.Exists(projectBuildDirectory))
Directory.CreateDirectory(projectBuildDirectory);
List<string> scenes = new List<string>();
foreach(var scene in EditorBuildSettings.scenes)
{
if(scene.enabled)
scenes.Add(scene.path);
}
scenes = new[] { m_RunParameters.currentOpenScenePath },
scenes = scenes.ToArray(),
locationPathName = Path.Combine(projectBuildDirectory, $"{m_RunParameters.runName}.x86_64"),
#if PLATFORM_CLOUD_RENDERING
target = BuildTarget.CloudRendering,

正在加载...
取消
保存