您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
30 行
1.1 KiB
30 行
1.1 KiB
using System;
|
|
using Unity.Simulation;
|
|
|
|
namespace UnityEngine.Perception.Randomization.Scenarios
|
|
{
|
|
/// <summary>
|
|
/// Defines a scenario that is compatible with the Run in Unity Simulation window
|
|
/// </summary>
|
|
/// <typeparam name="T">The type of constants to serialize</typeparam>
|
|
public abstract class UnitySimulationScenario<T> : Scenario<T> where T : UnitySimulationScenarioConstants, new()
|
|
{
|
|
/// <inheritdoc/>
|
|
public sealed override bool isScenarioComplete => currentIteration >= constants.totalIterations;
|
|
|
|
/// <inheritdoc/>
|
|
protected sealed override void IncrementIteration()
|
|
{
|
|
currentIteration += constants.instanceCount;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public sealed override void DeserializeFromFile(string configFilePath)
|
|
{
|
|
base.DeserializeFromFile(Configuration.Instance.IsSimulationRunningInCloud()
|
|
? new Uri(Configuration.Instance.SimulationConfig.app_param_uri).LocalPath
|
|
: configFilePath);
|
|
currentIteration = constants.instanceIndex;
|
|
}
|
|
}
|
|
}
|