using System;
namespace UnityEngine.Perception.Randomization.Scenarios
{
///
/// A scenario that runs for a fixed number of frames during each iteration
///
[AddComponentMenu("Perception/Randomization/Scenarios/Fixed Length Scenario")]
public class FixedLengthScenario : USimScenario
{
public int framesPerIteration = 1;
public int startingIteration;
///
/// Returns whether the current scenario iteration has completed
///
public override bool isIterationComplete => currentIterationFrame >= framesPerIteration;
///
/// Returns whether the scenario has completed
///
public override bool isScenarioComplete => currentIteration >= constants.totalIterations;
///
/// Called before the scenario begins iterating
///
public override void OnInitialize()
{
#if UNITY_EDITOR
currentIteration = startingIteration;
#else
base.OnInitialize();
#endif
}
}
}