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