using System; using Unity.Simulation; namespace UnityEngine.Perception.Randomization.Scenarios { /// /// Defines a scenario that is compatible with the Run in Unity Simulation window /// /// The type of constants to serialize public abstract class UnitySimulationScenario : Scenario where T : UnitySimulationScenarioConstants, new() { /// public sealed override bool isScenarioComplete => currentIteration >= constants.totalIterations; /// protected sealed override void IncrementIteration() { currentIteration += constants.instanceCount; } /// 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; } } }