浏览代码

Merge pull request #104 from Unity-Technologies/usim-iteration-offset-fix

USim scenario iteration offset fix
/main
GitHub 4 年前
当前提交
b9010f34
共有 2 个文件被更改,包括 7 次插入11 次删除
  1. 2
      com.unity.perception/CHANGELOG.md
  2. 16
      com.unity.perception/Runtime/Randomization/Scenarios/USimScenario.cs

2
com.unity.perception/CHANGELOG.md


### Fixed
USimScenario now correctly deserializes app-params before offsetting the current scenario iteration when executing on Unity Simulation
## [0.5.0-preview.1] - 2020-10-14
### Known Issues

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;
}
}

正在加载...
取消
保存