浏览代码

USim scenario now offsets the current scenario iteration directly after app-param deserialization

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

16
com.unity.perception/Runtime/Randomization/Scenarios/USimScenario.cs


using System;
using Unity.Simulation;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
{

public sealed override bool isScenarioComplete => currentIteration >= constants.totalIterations;
/// <summary>
/// OnAwake is executed directly after this scenario has been registered and initialized
/// </summary>
protected sealed override void OnAwake()
{
currentIteration = constants.instanceIndex;
}
/// <summary>
/// Progresses the current scenario iteration
/// </summary>
protected sealed override void IncrementIteration()

/// </summary>
public sealed override void Deserialize()
{
if (string.IsNullOrEmpty(Unity.Simulation.Configuration.Instance.SimulationConfig.app_param_uri))
if (Configuration.Instance.IsSimulationRunningInCloud())
constants = Configuration.Instance.GetAppParams<T>();
else
else
constants = Unity.Simulation.Configuration.Instance.GetAppParams<T>();
currentIteration = constants.instanceIndex;
}
}

正在加载...
取消
保存