Class ScenarioBase
Derive ScenarioBase to implement a custom scenario
Inherited Members
Namespace: UnityEngine.Perception.Randomization.Scenarios
Assembly: solution.dll
Syntax
[DefaultExecutionOrder(-1)]
public abstract class ScenarioBase : MonoBehaviour
Fields
Name | Description |
---|---|
quitOnComplete | If true, this scenario will quit the Unity application when it's finished executing |
Properties
Name | Description |
---|---|
activeScenario | Returns the active parameter scenario in the scene |
configFileName | The name of the Json file this scenario's constants are serialized to/from. |
currentIteration | The current iteration index of the scenario |
currentIterationFrame | The number of frames that have elapsed since the current scenario iteration was Setup |
defaultConfigFileAssetPath | Returns the asset location of the JSON serialized configuration. This API is used for finding the config file using the AssetDatabase API. |
defaultConfigFilePath | Returns the absolute file path of the JSON serialized configuration |
framesSinceInitialization | The number of frames that have elapsed since the scenario was initialized |
genericConstants | Returns this scenario's non-typed serialized constants |
isIterationComplete | Returns whether the current scenario iteration has completed |
isScenarioComplete | Returns whether the entire scenario has completed |
randomizers | Return the list of randomizers attached to this scenario |
Methods
Name | Description |
---|---|
Awake() | Awake is called when this scenario MonoBehaviour is created or instantiated |
CreateRandomizer<T>() | Creates a new randomizer and adds it to this scenario |
DeserializeFromFile() | Overwrites this scenario's randomizer settings and scenario constants using a configuration file located at this scenario's defaultConfigFilePath |
DeserializeFromFile(string) | Overwrites this scenario's randomizer settings and scenario constants using a configuration file located at the provided file path |
DeserializeFromJson(string) | Overwrites this scenario's randomizer settings and scenario constants from a JSON serialized configuration |
GetRandomizerIndex<T>() | Returns the execution order index of a randomizer of the given type |
GetRandomizer<T>() | Finds and returns a randomizer attached to this scenario of the specified Randomizer type |
IncrementIteration() | Progresses the current scenario iteration |
OnDisable() | OnEnable is called when this scenario is disabled |
OnEnable() | OnEnable is called when this scenario is enabled |
RemoveRandomizer<T>() | Removes a randomizer of the specified type from this scenario |
ReorderRandomizer(int, int) | Moves a randomizer from one index to another |
ResetRandomStateOnIteration() | Resets SamplerState.randomState with a new seed value generated by hashing this Scenario's randomSeed with its currentIteration |
SerializeToFile() | Serializes the scenario's constants and randomizer settings to a JSON file located at the path resolved by the defaultConfigFilePath scenario property |
SerializeToJson() | Serializes the scenario's constants and randomizer settings to a JSON string |
Start() | Start is called after Awake but before the first Update method call |
Update() | Update is called once per frame |