浏览代码

Merge branch 'randomizers' into tutorial_sample_project

/main
mohsen.k 4 年前
当前提交
f98eeb48
共有 86 个文件被更改,包括 521 次插入554 次删除
  1. 11
      README.md
  2. 74
      com.unity.perception/Documentation~/Randomization/Index.md
  3. 50
      com.unity.perception/Documentation~/Randomization/Scenarios.md
  4. 4
      com.unity.perception/Editor/Randomization/Editors/RunInUSimWindow.cs
  5. 7
      com.unity.perception/Editor/Randomization/Uxml/Randomizer/AddRandomizerMenu.uxml
  6. 4
      com.unity.perception/Editor/Randomization/Uxml/Randomizer/MenuDirectoryElement.uxml
  7. 15
      com.unity.perception/Editor/Randomization/Uxml/Randomizer/RandomizerElement.uxml
  8. 4
      com.unity.perception/Editor/Randomization/Uxml/Randomizer/RandomizerList.uxml
  9. 31
      com.unity.perception/Editor/Randomization/Uxml/RunInUSimWindow.uxml
  10. 16
      com.unity.perception/Editor/Randomization/Uxml/ScenarioBaseElement.uxml
  11. 2
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/AddRandomizerMenu.cs
  12. 2
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/ColorRandomizerTag.cs
  13. 2
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/HueOffsetRandomizerTag.cs
  14. 2
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/RotationRandomizerTag.cs
  15. 2
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/TextureRandomizerTag.cs
  16. 17
      com.unity.perception/Runtime/Randomization/Scenarios/Scenario.cs
  17. 8
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs
  18. 2
      com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml
  19. 2
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs
  20. 8
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs
  21. 2
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs
  22. 3
      com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs
  23. 3
      com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs
  24. 14
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs
  25. 29
      com.unity.perception/Documentation~/Randomization/RandomizerTags.md
  26. 42
      com.unity.perception/Documentation~/Randomization/Randomizers.md
  27. 169
      com.unity.perception/Editor/Randomization/Uss/Styles.uss
  28. 3
      com.unity.perception/Editor/Randomization/Uss/Styles.uss.meta
  29. 3
      com.unity.perception/Editor/Randomization/Uxml/Parameter.meta
  30. 3
      com.unity.perception/Editor/Randomization/Uxml/Sampler.meta
  31. 3
      com.unity.perception/Editor/Randomization/VisualElements/Parameter.meta
  32. 12
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerReorderingIndicator.cs
  33. 3
      com.unity.perception/Editor/Randomization/VisualElements/Sampler.meta
  34. 36
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/SunAngleRandomizer.cs
  35. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/SunAngleRandomizer.cs.meta
  36. 8
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/SunAngleRandomizerTag.cs
  37. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/SunAngleRandomizerTag.cs.meta
  38. 8
      com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalOptionElement.uxml
  39. 12
      com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalParameterTemplate.uxml
  40. 10
      com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterDrawer.uxml
  41. 6
      com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterElement.uxml
  42. 10
      com.unity.perception/Editor/Randomization/Uxml/Sampler/SamplerElement.uxml
  43. 182
      com.unity.perception/Documentation~/Randomization/Tutorial.md
  44. 109
      com.unity.perception/Editor/Randomization/Uss/ParameterStyles.uss
  45. 8
      com.unity.perception/Editor/Randomization/Uss/ParameterStyles.uss.meta
  46. 16
      com.unity.perception/Editor/Randomization/Uss/SamplerStyles.uss
  47. 8
      com.unity.perception/Editor/Randomization/Uss/SamplerStyles.uss.meta
  48. 21
      com.unity.perception/Editor/Randomization/Uss/ScenarioStyles.uss
  49. 3
      com.unity.perception/Editor/Randomization/Uss/ScenarioStyles.uss.meta
  50. 3
      com.unity.perception/Editor/Randomization/Uss/AddRandomizerMenuStyles.uss.meta
  51. 19
      com.unity.perception/Editor/Randomization/Uss/AddRandomizerMenuStyles.uss
  52. 8
      com.unity.perception/Editor/Randomization/Uxml/CategoricalOptionElement.uxml
  53. 12
      com.unity.perception/Editor/Randomization/Uxml/CategoricalParameterTemplate.uxml
  54. 6
      com.unity.perception/Editor/Randomization/Uxml/ParameterElement.uxml
  55. 10
      com.unity.perception/Editor/Randomization/Uxml/SamplerElement.uxml
  56. 10
      com.unity.perception/Editor/Randomization/Uxml/ParameterDrawer.uxml
  57. 12
      com.unity.perception/Editor/Randomization/VisualElements/ParameterDragBar.cs
  58. 0
      /com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalOptionElement.uxml.meta
  59. 0
      /com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalParameterTemplate.uxml.meta
  60. 0
      /com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml
  61. 0
      /com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml.meta
  62. 0
      /com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterElement.uxml.meta
  63. 0
      /com.unity.perception/Editor/Randomization/Uxml/Sampler/SamplerElement.uxml.meta
  64. 0
      /com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterDrawer.uxml.meta
  65. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs.meta
  66. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ColorHsvaField.cs
  67. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ColorHsvaField.cs.meta
  68. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs
  69. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs.meta
  70. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs.meta
  71. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerReorderingIndicator.cs.meta
  72. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs
  73. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs.meta
  74. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Sampler/RandomSeedField.cs.meta
  75. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs.meta
  76. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs
  77. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs
  78. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Sampler/RandomSeedField.cs
  79. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs
  80. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs.meta
  81. 0
      /com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs

11
README.md


## License
* [License](com.unity.perception/LICENSE.md)
## Citation
If you find this package useful, consider citing it using:
```
@misc{com.unity.perception2020,
title={Unity {P}erception Package},
author={{Unity Technologies}},
howpublished={\url{https://github.com/Unity-Technologies/com.unity.perception}},
year={2020}
}
```

74
com.unity.perception/Documentation~/Randomization/Index.md


*NOTICE: The perception randomization toolset is currently marked as experimental and will experience a number of updates in the near future.*
The randomization toolset simplifies randomizing aspects of generating synthetic data. It facilitates exposing parameters for randomization, offers samplers to pick random values from parameters, and provides scenarios to define a full randomization process. Each of these also allows for custom implementations to fit particular randomization needs.
The randomization toolset simplifies randomizing aspects of generating synthetic data. It facilitates exposing parameters for randomization, offers samplers to pick random values from parameters, and provides scenarios to coordinate a full randomization process. Each of these also allows for custom implementations to fit particular randomization needs.
**What is Domain Randomization?**
#### What is Domain Randomization?
**How can a Unity project be randomized using the Perception Randomization toolset?**
#### How can a Unity project be randomized using the Perception Randomization toolset?
1. Create a parameter configuration
2. Add parameters to the parameter configuration
3. Customize parameter properties and samplers
4. Create a scenario to control simulation execution
1. Create a scenario
2. Define and add randomizers to the scenario
3. Customize parameters and samplers in the randomizers
4. Generate randomized perception data
As the first step mentions, randomization begins with creating a new ParameterConfiguration component. From here, users can configure and organize new random parameters to control various aspects of their simulation directly from the inspector in the Unity editor.
Beginning with step 1, add a scenario component to your simulation. This scenario will act as the central hub for all randomization activities that occur when your scene is executed.
![Example Parameters](./Images/ParameterConfiguration.png)
Next, add a few randomizers to the scenario. The randomizers, in conjunction with the scenario, will perform the actual randomization activities within the simulation.
Next, create a few parameters and modify their properties. Parameters often customize their random variables through the parameter configuration using samplers. Samplers enable users to specify a type of probabilty distribution to use when generating random values.
After adding the necessary randomizers, configure the random parameters assigned to each randomizer to further customize how the simulation is randomized. The random parameters and samplers exposed in each randomizer's inspector can be manipulated to specify different probabilty distributions to use when generating random values.
Finally, add a Scenario component to the scene. Scenarios are used to coordinate the application of randomizations during the execution of a simulation.
Once the project has been randomized and your scene has been configured with the data capture tools available in the perception package, enter play mode in the editor or execute your scenario through the Unity Simulation Cloud service to generate domain randomized perception data.
Continue reading for more details concerning the primary components driving randomizations in the perception package, including:
1. Scenarios
2. Randomizers
3. Randomizer Tags
4. Parameters
5. Samplers
Continue reading for more details concerning the three primary components driving randomizations in the perception package: parameters, samplers, and scenarios.
## Scenarios
## Parameters
Within a randomized simulation, the scenario component has three responsibilities:
1. Controlling the execution flow of your simulation
2. Defining a list of randomizers
3. Defining constants that can be configured externally from a built Unity player
Parameters are used to map common types of simulation properties to random variables. For example, a Vector3 size parameter can be used to randomize the x, y, and z dimensions of an obstacle. Or a material parameter can be used to swap between different terrain surface materials. Additionally, parameter sub-properties can be modified from the parameter configuration in playmode better visualize the impact of different randomization settings.
The fundamental principle of domain randomization is to simulate environments under a variety of randomized conditions. Each **iteration** of a scenario is intended to encapsulate one complete run of a simulated environment under uniquely randomized conditions. Scenarios futher define what conditions determine the end of an iteration and how many iterations to perform.
To read more about how to create custom parameter types, navigate over to the [parameters doc](Parameters.md).
To actually randomize a simulation, randomizers can be added to a scenario to vary different simulation properties. At runtime, the scenario will execute each randomizer according to its place within the randomizers list.
Scenarios can also define constants from which to expose global simulation behaviors automatically. By modifying serialized constants externally, users can customize their simulation runtime even after their project has been built.
To read more about scenarios and how to customize them, navigate over to the [scenarios doc](Scenarios.md).
## Randomizers
Randomizers encapsulate specific randomization activities to perform during the lifecycle of a randomized simulation. For example, randomizers exist for spawning objects, repositioning lights, varying the color of objects, etc. Randomizers expose random parameters to their inspector interface to further customize these variations.
To read more about how to create custom parameter types, navigate over to the [randomizers doc](Randomizers.md).
## Samplers
Samplers generate random float values by sampling from probability distributions. They are considered bounded since each random sampler generates float values within a range defined by a minumum and maximum value. The values generated from samplers are often used to randomize the sub components of parameters.
## Randomizer Tags
![Example Parameters](./Images/ColorParameter.png)
RandomizerTags are the primary mechanism by which randomizers query for a certain subset of GameObjects to randoize within a simulation. For example, a rotation randomizer could query for all GameObjects with a RotationRandomizerTag component to obtain an array of all objects the randomizer should vary for the given simulation iteration.
For example, a color parameter has four independently randomizable components: hue, saturation, value, and alpha. Each of the four samplers attached to a color parameter can employ a unique probability distribution to customize how new colors are sampled within a simulation. Out of the box, the perception package supports uniform and normal distribution sampling. So in our color example, a user may choose a normal distribution for their hue, a uniform distribution for saturation, and a constant value sampler for the value and alpha color components.
To read more about how to use RandomizerTags, navigate over to the [RandomizerTags doc](RandomizerTags.md).
Take a look at the [samplers doc](Samplers.md) to learn more about implementing custom probability distributions and samplers that can integrate with the perception package.
## Parameters
## Scenarios
Parameters are classes that utilize samplers to deterministically generate random typed values. Parameters are often exposed within the inspector interface of randomizers to allow users to customize said randomizer's behavior. To accomplish this, parameters combine and transform the float values produced by one or more samplers into various C# types. For example, a Vector3 parameter can be used to map three samplers to the x, y, and z dimensions of a GameObject. Or a material parameter can utilize a sampler to randomly select one material from a list of possible options.
Scenarios have three responsibilities:
1. Controlling the execution flow of your simulation
2. Customizing the application of random parameters in your project
3. Defining constants that can be configured externally from a built Unity player
To read more about how to create custom parameter types, navigate over to the [parameters doc](Parameters.md).
The fundamental principle of domain randomization is to simulate environments under a variety of randomized conditions. Each **iteration** of a scenario is intended to encapsulate one complete run of a simulated environment under uniquely randomized conditions. Scenarios determine how to setup a new iteration, what conditions determine the end of an iteration, how to clean up a completed iteration, and finally how many iterations to perform. Each of these behaviors can be customized for a new scenario by deriving from the Scenario class in the perception package.
It is possible to configure parameters to affect simulation properties directly from the parameter configuration. While useful, this feature is constrained to a particular set of use cases. Instead, a user can reference existing parameters in their scenario to implement more intricate randomizations. For example, a user can reference a `SpawnCount` parameter and a `ObjectPosition` parameter to randomize the positions of a dynamic number of objects during the setup step of a scenario.
## Samplers
![Example Parameters](./Images/TestScenario.png)
Samplers generate bounded random float values by sampling from probability distributions. They are considered bounded since each random sampler generates float values within a range defined by a minumum and maximum value.
Finally, scenarios define constants from which to expose global simulation behaviors automatically. By modifying serialized constants externally, users can customize their simulation runtime even after their project has been built.
Take a look at the [samplers doc](Samplers.md) to learn more about implementing custom probability distributions and samplers that can integrate with the perception package.
Visit our [randomization tutorial doc](Tutorial.md) to get started using the perception package's randomization tools in an example project.
Visit our [randomization tutorial doc]() to get started using the perception package's randomization tools in an example project.

50
com.unity.perception/Documentation~/Randomization/Scenarios.md


# Scenarios
Scenarios have three responsibilities:
1. Controlling the execution flow of your simulation
2. Customizing the application of random parameters in your project
3. Defining constants that can be configured externally from a built Unity player
1. Controlling the execution flow of your simulation
2. Defining a list of randomizers
3. Defining constants that can be configured externally from a built Unity player
By default, the perception package includes one ready-made scenario, the `FixedLengthScenario` class. This scenario runs each iteration for a fixed number of frames and is compatible with the Run in USim window for cloud simulation execution.
## Scenario Cloud Execution (USim)
Users can utilize Unity's Unity Simulation (USim) service to execute a scenario in the cloud through the perception package's Run in USim window. To open this window from the Unity editor using the top menu bar, navigate to `Window -> Run in USim`.
From the newly opened editor window, customize the following settings to configure a new USim run:
1. **Run Name** - the name of the USim run (example: TestRun0)
2. **Total Iterations** - The number of scenario iterations to complete during the run
3. **Instance Count** - The number of USim worker instances to distribute execution between
4. **Main Scene** - The Unity scene to execute
5. **Scenario** - The scenario to execute
6. **USim Worker Config** - the type of USim worker instance to execute the scenario with. Determines per instance specifications such as the number of CPU cores, amount of memory, and presence of a GPU for accelerated execution.
By default, the perception package includes one ready-made scenario, the `FixedFrameLengthScenario` class. This scenario is useful for when all created parameters have target GameObjects configured directly in the `ParameterConfiguration` and the scenario execution requires little modification.
NOTE: To execute a scenario using the Run in USim window, the scenario class must implement the USimScenario class.
More commonly, users will find the need to create their own Scenario class. Below is an overview of the more common scenario properties and methods a user can override:
## Custom Scenarios
For use cases where the scenario should run for an arbitrary number of frames, implementing a custom scenario may be necessary. Below are the two most common scenario properties a user might want to override to implement custom scenario iteration conditions:
3. **Initialize** - actions to complete before the scenario has begun iterating
4. **Setup** - actions to complete at the beginning of each iteration
5. **Teardown** - actions to complete at the end of each iteration
6. **OnComplete** - actions to complete after the scenario as completed
Scenarios define constants from which to expose global simulation behaviors like a starting iteration value or a total iteration count. Users can serialize these scenario constants to JSON, modify them in an external program, and finally reimport the JSON constants at runtime to configure their simulation even after their project has been built. Below is an example of the constants used in the `FixedLengthScenario` class:
Scenarios define constants from which to expose global simulation behaviors like a starting iteration value or a total iteration count. Users can serialize these scenario constants to JSON, modify them in an external program, and finally reimport the JSON constants at runtime to configure their simulation even after their project has been built. Below is an example of the constants class used in the `FixedLengthScenario` class:
public class Constants
public class Constants : USimConstants
public int iterationFrameLength = 1;
public int startingIteration;
public int totalIterations = 1000;
public int framesPerIteration = 1;
A few key things to note here:
1. Make sure to include the [Serializable] attribute on a constant class. This will ensure that the constants can be manipulated from the Unity inspector.
2. By default, UnityEngine.Object class references cannot be serialized to JSON in a meaningful way. This includes Monobehaviors and SerializedObjects. For more information on what can and can't be serialized, take a look at the [Unity JsonUtility manual](https://docs.unity3d.com/ScriptReference/JsonUtility.html).
3. A scenario class's Serialize() and Deserialized() methods can be overriden to implement custom serialization strategies.
There are a few key things to note here:
1. The constants class will need to inherit from USimConstants to be compatible with the Run in USim window. Deriving from USimConstants will add a few key properties to the constants class that are needed to coordinate a USim run.
2. Make sure to include the [Serializable] attribute on a constant class. This will ensure that the constants can be manipulated from the Unity inspector.
3. By default, UnityEngine.Object class references cannot be serialized to JSON in a meaningful way. This includes Monobehaviors and SerializedObjects. For more information on what can and can't be serialized, take a look at the [Unity JsonUtility manual](https://docs.unity3d.com/ScriptReference/JsonUtility.html).
4. A scenario class's Serialize() and Deserialized() methods can be overriden to implement custom serialization strategies.

4
com.unity.perception/Editor/Randomization/Editors/RunInUSimWindow.cs


void CreateLinuxBuildAndZip()
{
// Ensure that scenario serialization is enabled
var scenario = (ScenarioBase)m_ScenarioField.value;
scenario.deserializeOnStart = true;
// Create build directory
var pathToProjectBuild = Application.dataPath + "/../" + "Build/";
if (!Directory.Exists(pathToProjectBuild + m_RunNameField.value))

7
com.unity.perception/Editor/Randomization/Uxml/Randomizer/AddRandomizerMenu.uxml


<UXML xmlns="UnityEngine.UIElements">
<VisualElement name="container" style="width: 225px; height: 300px; background-color: #383838; border-width: 1px; border-color: #232323;">
<Style src="../../Uss/AddRandomizerMenuStyles.uss"/>
<TextField name="search-bar" style="padding: 3px;"/>
<Style src="../../Uss/Styles.uss"/>
<TextField name="search-bar" class="randomizer__menu-search-bar" style="padding: 3px;"/>
<VisualElement name="directory-chevron" class="chevron-left"/>
<VisualElement name="directory-chevron" class="randomization__chevron-left"/>
<VisualElement class="randomizer__menu-search-icon"/>
</VisualElement>
</UXML>

4
com.unity.perception/Editor/Randomization/Uxml/Randomizer/MenuDirectoryElement.uxml


<UXML xmlns="UnityEngine.UIElements">
<VisualElement style="flex-direction: row; justify-content: space-between; align-items: center;" class="menu-element">
<VisualElement style="flex-direction: row; justify-content: space-between; align-items: center;" class="randomizer__add-menu-directory-item">
<VisualElement class="chevron-right"/>
<VisualElement class="randomization__chevron-right"/>
</VisualElement>
</UXML>

15
com.unity.perception/Editor/Randomization/Uxml/Randomizer/RandomizerElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement class="randomizer-element" style="flex-direction: row;">
<Style src="../Uss/ParameterStyles.uss"/>
<VisualElement name="drag-handle" class="drag-handle"/>
<UXML xmlns="UnityEngine.UIElements">
<VisualElement class="randomizer__element">
<VisualElement name="drag-handle" class="randomizer__drag-handle"/>
<VisualElement name="collapse" class="collapse-toggle foldout-open"/>
<VisualElement name="collapse" class="randomization__collapse-toggle foldout-open"/>
<Button name="remove" class="remove-option-button"/>
<Button name="remove" class="randomization__remove-item-button"/>
<VisualElement name="properties" class="properties-container" style="padding-left: 16px;"/>
<VisualElement name="properties" class="randomization__collapsible-container" style="padding-left: 16px;"/>
</VisualElement>
</VisualElement>
</UXML>

4
com.unity.perception/Editor/Randomization/Uxml/Randomizer/RandomizerList.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement name="randomizers-container" class="dark-viewport" style="margin-top: 6px; min-height: 100px;"/>
<UXML xmlns="UnityEngine.UIElements">
<VisualElement name="randomizers-container" class="scenario__dark-viewport" style="margin-top: 6px; min-height: 100px;"/>
<VisualElement style="flex-direction: row; align-items: center; justify-content: center; margin-top: 4px;">
<Button name="add-randomizer-button" text="Add Randomizer"/>
<Button name="expand-all" text="Expand All"/>

31
com.unity.perception/Editor/Randomization/Uxml/RunInUSimWindow.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements" xmlns:randEditor="UnityEngine.Perception.Randomization.Editor">
<VisualElement>
<Style src="../Uss/RunInUSimStyles.uss"/>
<VisualElement class="dark-viewport" style="margin-bottom: 20px;">
<VisualElement style="">
<TextField name="run-name" label="Run Name"/>
<editor:IntegerField name="total-iterations" label="Total Iterations"/>
<editor:IntegerField name="instance-count" label="Instance Count" max-value="10000"/>
<editor:ObjectField name="main-scene" label="Main Scene" allow-scene-objects="false"/>
<editor:ObjectField name="scenario" label="Scenario"/>
<VisualElement class="unity-base-field">
<Label text="USim worker config" class="unity-base-field__label"/>
<editor:ToolbarMenu name="sys-param" class="unity-base-field__input" style="border-width: 1px;"/>
</VisualElement>
<VisualElement style="align-items: center;">
<Button name="run-button" text="Build and Run" style="margin: 10px; padding: 2 20; font-size: 13px;"/>
</VisualElement>
</VisualElement>
</VisualElement>
<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<TextField name="run-name" label="Run Name"/>
<editor:IntegerField name="total-iterations" label="Total Iterations"/>
<editor:IntegerField name="instance-count" label="Instance Count" max-value="10000"/>
<editor:ObjectField name="main-scene" label="Main Scene" allow-scene-objects="false"/>
<editor:ObjectField name="scenario" label="Scenario"/>
<VisualElement class="unity-base-field">
<Label text="USim worker config" class="unity-base-field__label"/>
<editor:ToolbarMenu name="sys-param" class="unity-base-field__input" style="border-width: 1px;"/>
</VisualElement>
<VisualElement style="align-items: center;">
<Button name="run-button" text="Build and Run" style="margin: 10px; padding: 2 20; font-size: 13px;"/>
</VisualElement>
</UXML>

16
com.unity.perception/Editor/Randomization/Uxml/ScenarioBaseElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement>
<Style src="../Uss/ScenarioStyles.uss"/>
<TextElement class="info-box" text="Scenarios control the execution flow of your simulation by applying randomization parameters. Make sure to always have only one scenario active within your scene."/>
<Style src="../Uss/Styles.uss"/>
<TextElement
class="scenario__info-box"
text="Scenarios control the execution flow of your simulation by applying randomization parameters. Make sure to always have only one scenario active within your scene."/>
<VisualElement name="configuration-container" class="dark-viewport" style="padding-left: 16px">
<VisualElement class="scenario__dark-viewport" style="padding-left: 16px">
<editor:PropertyField binding-path="constants" tooltip="A custom list of parameters for this scenario that will be JSON serialized. You can add or remove constants by modifying the code for this scenario class. Only these properties of the simulation can be changed externally from a built player."/>
<editor:PropertyField
binding-path="constants"
tooltip="A list of parameters for this scenario that will be JSON serialized."/>
<editor:PropertyField tooltip="Read constants from JSON when the application starts" name="deserialize-on-start" label="Deserialize On Start" binding-path="deserializeOnStart"/>
<VisualElement style="flex-direction: row;">
<Button name="serialize-constants" text="Serialize Constants" style="flex-grow: 1;"/>
<Button name="deserialize-constants" text="Deserialize Constants" style="flex-grow: 1;"/>

</VisualElement>
</UXML>

2
com.unity.perception/Editor/Randomization/VisualElements/Randomizer/AddRandomizerMenu.cs


public MenuItemElement(MenuItem menuItem, AddRandomizerMenu menu)
{
text = menuItem.itemName;
AddToClassList("menu-element");
AddToClassList("randomizer__add-menu-directory-item");
RegisterCallback<MouseUpEvent>(evt => menu.AddRandomizer(menuItem.randomizerType));
}
}

2
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/ColorRandomizerTag.cs


/// <summary>
/// Used in conjunction with a ColorRandomizer to vary the material color of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/ColorRandomizerTag")]
[AddComponentMenu("Perception/RandomizerTags/Color Randomizer Tag")]
public class ColorRandomizerTag : RandomizerTag { }
}

2
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/HueOffsetRandomizerTag.cs


/// <summary>
/// Used in conjunction with a HueOffsetRandomizer to vary the hue of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/HueOffsetRandomizerTag")]
[AddComponentMenu("Perception/RandomizerTags/Hue Offset Randomizer Tag")]
public class HueOffsetRandomizerTag : RandomizerTag { }
}

2
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/RotationRandomizerTag.cs


/// <summary>
/// Used in conjunction with a RotationRandomizer to vary the rotation of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/RotationRandomizerTag")]
[AddComponentMenu("Perception/RandomizerTags/Rotation Randomizer Tag")]
public class RotationRandomizerTag : RandomizerTag { }
}

2
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/TextureRandomizerTag.cs


/// <summary>
/// Used in conjunction with a TextureRandomizer to vary the material texture of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/TextureRandomizerTag")]
[AddComponentMenu("Perception/RandomizerTags/Texture Randomizer Tag")]
public class TextureRandomizerTag : RandomizerTag { }
}

17
com.unity.perception/Runtime/Randomization/Scenarios/Scenario.cs


/// <exception cref="ScenarioException"></exception>
public override void Deserialize()
{
if (!File.Exists(serializedConstantsFilePath))
throw new ScenarioException($"JSON scenario constants file does not exist at path {serializedConstantsFilePath}");
var jsonText = File.ReadAllText(serializedConstantsFilePath);
constants = JsonUtility.FromJson<T>(jsonText);
if (string.IsNullOrEmpty(serializedConstantsFilePath))
{
Debug.Log("No constants file specified. Running scenario with built in constants.");
}
else if (File.Exists(serializedConstantsFilePath))
{
var jsonText = File.ReadAllText(serializedConstantsFilePath);
constants = JsonUtility.FromJson<T>(jsonText);
}
else
{
Debug.LogWarning($"JSON scenario constants file does not exist at path {serializedConstantsFilePath}");
}
}
}
}

8
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs


[HideInInspector] public bool quitOnComplete = true;
/// <summary>
/// When true, this scenario will deserializes constants from a Json file before it begins executing
/// </summary>
[HideInInspector] public bool deserializeOnStart;
/// <summary>
/// The name of the Json file this scenario's constants are serialized to/from.
/// </summary>
[HideInInspector] public string serializedConstantsFileName = "constants";

void Start()
{
if (deserializeOnStart)
Deserialize();
Deserialize();
}
void Update()

2
com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml


<VisualElement>
<VisualElement style="flex-direction: row; margin: 1px, 1px, 1px, 3px;">
<Label text="Range" class="unity-base-field__label" style="min-width: 147;"/>
<VisualElement class="float-range" style="flex-grow: 1; flex-direction: row;">
<VisualElement class="sampler__float-range" style="flex-grow: 1; flex-direction: row;">
<editor:FloatField label="Min" tooltip="Minimum" name="minimum" style="flex-grow: 1; flex-shrink: 0; flex-basis: 0; margin-bottom: 0;"/>
<editor:FloatField label="Max" tooltip="Maximum" name="maximum" style="flex-grow: 1; flex-shrink: 0; flex-basis: 0; margin-right: 2px; margin-bottom: 0;"/>
</VisualElement>

2
com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs


m_Collapsed = property.FindPropertyRelative("collapsed");
AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
$"{StaticData.uxmlDir}/ParameterDrawer.uxml").CloneTree(this);
$"{StaticData.uxmlDir}/Parameter/ParameterDrawer.uxml").CloneTree(this);
var collapseToggle = this.Q<VisualElement>("collapse");
collapseToggle.RegisterCallback<MouseUpEvent>(evt => collapsed = !collapsed);

8
com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs


public ParameterElement(SerializedProperty property)
{
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
$"{StaticData.uxmlDir}/ParameterElement.uxml");
$"{StaticData.uxmlDir}/Parameter/ParameterElement.uxml");
template.CloneTree(this);
m_SerializedProperty = property;
m_PropertiesContainer = this.Q<VisualElement>("properties");

void CreateCategoricalParameterFields()
{
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
$"{StaticData.uxmlDir}/CategoricalParameterTemplate.uxml").CloneTree();
$"{StaticData.uxmlDir}/Parameter/CategoricalParameterTemplate.uxml").CloneTree();
var optionsProperty = m_SerializedProperty.FindPropertyRelative("m_Categories");
var probabilitiesProperty = m_SerializedProperty.FindPropertyRelative("probabilities");

void ToggleProbabilityFields(bool toggle)
{
if (toggle)
listView.AddToClassList("uniform-probability");
listView.AddToClassList("collapsed");
listView.RemoveFromClassList("uniform-probability");
listView.RemoveFromClassList("collapsed");
}
ToggleProbabilityFields(uniformToggle.value);
if (Application.isPlaying)

2
com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs


m_ProbabilitiesProperty = probabilitiesProperty;
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
$"{StaticData.uxmlDir}/CategoricalOptionElement.uxml");
$"{StaticData.uxmlDir}/Parameter/CategoricalOptionElement.uxml");
template.CloneTree(this);
}

3
com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs


{
public FloatRangeElement(SerializedProperty property)
{
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>($"{StaticData.uxmlDir}/FloatRangeElement.uxml");
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
$"{StaticData.uxmlDir}/Sampler/FloatRangeElement.uxml");
template.CloneTree(this);
var minimumField = this.Q<FloatField>("minimum");

3
com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs


public SamplerElement(SerializedProperty property, Parameter parameter)
{
m_Property = property;
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>($"{StaticData.uxmlDir}/SamplerElement.uxml");
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
$"{StaticData.uxmlDir}/Sampler/SamplerElement.uxml");
template.CloneTree(this);
m_Parameter = parameter;

14
com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs


float m_Offset;
RandomizerElement m_RandomizerElement;
VisualElement m_DragHandle;
VisualElement m_DragBar;
VisualElement m_ReorderingIndicator;
VisualElement m_ParameterContainer;
protected override void RegisterCallbacksOnTarget()

}
m_ParameterContainer = target.parent;
m_DragBar = new ParameterDragBar();
m_DragBar.style.width = new StyleLength(m_ParameterContainer.resolvedStyle.width);
target.parent.Add(m_DragBar);
m_ReorderingIndicator = new RandomizerReorderingIndicator();
m_ReorderingIndicator.style.width = new StyleLength(m_ParameterContainer.resolvedStyle.width);
target.parent.Add(m_ReorderingIndicator);
m_DragBar.style.top = evt.localMousePosition.y + m_Offset;
m_ReorderingIndicator.style.top = evt.localMousePosition.y + m_Offset;
m_Active = true;
m_DragHandle.CaptureMouse();

if (!m_Active || !m_DragHandle.HasMouseCapture())
return;
m_DragBar.style.top = evt.localMousePosition.y + m_Offset;
m_ReorderingIndicator.style.top = evt.localMousePosition.y + m_Offset;
evt.StopPropagation();
}

return;
var dragBarY = evt.localMousePosition.y + m_Offset;
m_DragBar.RemoveFromHierarchy();
m_ReorderingIndicator.RemoveFromHierarchy();
m_Active = false;
m_DragHandle.ReleaseMouse();

29
com.unity.perception/Documentation~/Randomization/RandomizerTags.md


# Randomizer Tags
RandomizerTags are the primary mechanism by which randomizers query for a certain subset of GameObjects to randomize within a simulation.
More specifically, RandomizerTags are components that can be added to GameObjects to register them with the active scenario's TagManager. This TagManager is aware of all objects with tags in the scene and can be queried to find all GameObjects that contain a specific tag. Below is a simple example of a ColorRandomizer querying for all GameObjects with a ColorRandomizerTag that it will apply a random material base color to:
```
[Serializable]
[AddRandomizerMenu("Perception/Color Randomizer")]
public class ColorRandomizer : Randomizer
{
static readonly int k_BaseColor = Shader.PropertyToID("_BaseColor");
public ColorHsvaParameter colorParameter;
protected override void OnIterationStart()
{
var taggedObjects = tagManager.Query<ColorRandomizerTag>();
foreach (var taggedObject in taggedObjects)
{
var renderer = taggedObject.GetComponent<MeshRenderer>();
renderer.material.SetColor(k_BaseColor, colorParameter.Sample());
}
}
}
```
RandomizerTags can also be used to customize how randomizers apply their randomizations to a particular GameObject. Visit [part two of the randomization tutorial]() to explore an in depth example of implementing a LightRandomizer that does exactly this.

42
com.unity.perception/Documentation~/Randomization/Randomizers.md


# Randomizers
Randomizers encapsulate specific randomization activities to perform during the execution of a randomized simulation. For example, randomizers exist for spawning objects, repositioning lights, varying the color of objects, etc. Randomizers expose random parameters to their inspector interface to further customize these variations. Users can add a set of randomizers to a scenario in order to define an ordered list randomization activities to perform during the lifecycle of a simulation.
To define an entirely new randomizer, derive the Randomizer class and implement one or more of the methods listed in the section below to randomize GameObjects during the runtime of a simulation.
## Randomizer Hooks
1. OnCreate() - called when the Randomizer is added or loaded to a scenario
2. OnIterationStart() - called at the start of a new scenario iteration
3. OnIterationEnd() - called the after a scenario iteration has completed
4. OnScenarioComplete() - called the after the entire scenario has completed
5. OnStartRunning() - called on the first frame a Randomizer is enabled
6. OnStopRunning() - called on the first frame a disabled Randomizer is updated
7. OnUpdate() - executed every frame for enabled Randomizers
## Randomizer Coding Example
Below is the code for the sample rotation randomizer included with the perception package:
```
[Serializable]
[AddRandomizerMenu("Perception/Rotation Randomizer")]
public class RotationRandomizer : Randomizer
{
public Vector3Parameter rotation = new Vector3Parameter();
protected override void OnIterationStart()
{
var taggedObjects = tagManager.Query<RotationRandomizerTag>();
foreach (var taggedObject in taggedObjects)
taggedObject.transform.rotation = Quaternion.Euler(rotation.Sample());
}
}
```
There are a few key things to note from this example:
1. Make sure to add the [Serializable] tag to all randomizer implementations to ensure that the randomizer can be customized and saved within the Unity Editor.
2. The [AddRandomizerMenu] attribute customizes the "Add Randomizer" sub menu path in the scenario inspector for a particular randomizer. In this example, the RotationRandomizer can be added to a scenario by opening the add randomizer menu and clicking `Perception -> Rotation Randomizer`.
3. The line `var taggedObjects = tagManager.Query<RotationRandomizerTag>();` uses RandomizerTags in combination with the current Scenario's tagManager to query for all objects with RotationRandomizerTags to obtain the subset of GameObjects within the simulation that need to have their rotations randomzied. To learn more about how RandomizerTags work, visit the [RandomizerTags doc](RandomizerTags.md).

169
com.unity.perception/Editor/Randomization/Uss/Styles.uss


/* General randomization classes */
.randomization__remove-item-button {
width: 12px;
height: 14px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/X.png");
}
.randomization__collapse-toggle {
flex-shrink: 0;
margin-right: 3px;
margin-left: 3px;
width: 10px;
height: 10px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/FoldoutOpen.png");
}
.collapsed .randomization__collapse-toggle {
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/FoldoutClosed.png");
}
.randomization__collapse-toggle:hover {
-unity-background-image-tint-color: cornflowerblue;
}
.collapsed .randomization__collapsible-container {
display: none;
}
.randomization__chevron-left {
height: 12px;
width: 12px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/ChevronLeft.png");
}
.randomization__chevron-right {
height: 12px;
width: 12px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/ChevronRight.png");
}
/* Scenario classes */
.scenario__info-box {
border-width: 1px;
border-color: #191919;
padding: 2px 4px 2px 4px;
white-space: normal;
margin-top: 4px;
margin-bottom: 4px;
}
.scenario__dark-viewport {
border-radius: 5px;
background-color: #191919;
padding: 2px;
}
/* Randomizer classes */
.randomizer__drag-bar {
width: 100px;
height: 6px;
background-color: rgba(100,149,237,0.4);
position: absolute;
}
.randomizer__element {
border-width: 2px;
border-radius: 5px;
margin: 2px 1px;
background-color: #383838;
flex-direction: row;
}
.randomizer__drag-handle {
flex-shrink: 0;
width: 16px;
height: 100%;
min-height: 20px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/DragHandle.png");
}
.randomizer__drag-handle:hover {
-unity-background-image-tint-color: black;
}
.randomizer__add-menu-directory-item {
padding: 2px 10px 2px 20px;
}
.randomizer__add-menu-directory-item:hover {
background-color: #3E5F96;
}
.randomizer__reordering-hover-indicator {
width: 100px;
height: 6px;
background-color: rgba(100,149,237,0.4);
position: absolute;
}
.randomizer__menu-search-icon {
position: absolute;
left: 10px;
top: 9px;
width: 10px;
height: 10px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/Search.png");
}
.randomizer__menu-search-bar .unity-base-text-field__input {
padding-left: 15px;
}
/* Parameter classes */
.parameter__categorical-option {
flex-direction: row;
background-color: #3F3F3F;
margin: 1px;
border-radius: 4px;
}
.parameter__categorical-options-list {
background-color: #191919;
border-radius: 4px;
margin-right: 2px;
padding: 3px;
border-bottom-right-radius: 0;
}
.parameter__categorical-option-property-field {
width: 0;
flex-grow: 1;
flex-shrink: 0;
}
.parameter__categorical-options-list-button {
align-self: flex-end;
border-width: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
background-color: #191919;
margin-top: 0;
margin-right: 2px;
}
.parameter__categorical-options-list-button:hover {
background-color: #2A2A2A;
}
.parameter__categorical-options-list-button:active {
color: cornflowerblue;
}
/* Sampler classes */
.sampler__type-menu {
flex-grow: 1.5;
border-radius: 3px;
border-width: 1px;
margin-top: 2px;
margin-right: 3px;
}
.sampler__float-range .unity-base-field__label {
min-width: auto;
margin-right: 4px;
}

3
com.unity.perception/Editor/Randomization/Uss/Styles.uss.meta


fileFormatVersion: 2
guid: a3321de444a246f59e8a0445d5d2bf5d
timeCreated: 1601665266

3
com.unity.perception/Editor/Randomization/Uxml/Parameter.meta


fileFormatVersion: 2
guid: 9dff455d50ac4549bac301eb5926c83c
timeCreated: 1601668963

3
com.unity.perception/Editor/Randomization/Uxml/Sampler.meta


fileFormatVersion: 2
guid: cdf29c5fa139470d961ca4605d792f0a
timeCreated: 1601668985

3
com.unity.perception/Editor/Randomization/VisualElements/Parameter.meta


fileFormatVersion: 2
guid: 198e373f78464aa7a4bf4211e82434dc
timeCreated: 1601669088

12
com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerReorderingIndicator.cs


using UnityEngine.UIElements;
namespace UnityEngine.Experimental.Perception.Randomization.Editor
{
class RandomizerReorderingIndicator : VisualElement
{
public RandomizerReorderingIndicator()
{
AddToClassList("randomizer__reordering-hover-indicator");
}
}
}

3
com.unity.perception/Editor/Randomization/VisualElements/Sampler.meta


fileFormatVersion: 2
guid: 650bdb8ee9ab42f99509974c7a076e00
timeCreated: 1601669132

36
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/SunAngleRandomizer.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the rotation of directional lights tagged with a SunAngleRandomizerTag
/// </summary>
[Serializable]
[AddRandomizerMenu("Perception/Sun Angle Randomizer")]
public class SunAngleRandomizer : Randomizer
{
public FloatParameter hour = new FloatParameter { value = new UniformSampler(0, 24)};
public FloatParameter timeOfYear = new FloatParameter { value = new UniformSampler(0, 1)};
public FloatParameter latitude = new FloatParameter { value = new UniformSampler(-90, 90)};
/// <summary>
/// Randomizes the rotation of tagged directional lights at the start of each scenario iteration
/// </summary>
protected override void OnIterationStart()
{
var lightObjects = tagManager.Query<SunAngleRandomizerTag>();
foreach (var lightObject in lightObjects)
{
var earthSpin = Quaternion.AngleAxis((hour.Sample() + 12f) / 24f * 360f, Vector3.down);
var timeOfYearRads = timeOfYear.Sample() * Mathf.PI * 2f;
var earthTilt = Quaternion.Euler(Mathf.Cos(timeOfYearRads) * 23.5f, 0, Mathf.Sin(timeOfYearRads) * 23.5f);
var earthLat = Quaternion.AngleAxis(latitude.Sample(), Vector3.right);
var lightRotation = earthTilt * earthSpin * earthLat;
lightObject.transform.rotation = Quaternion.Euler(90,0,0) * Quaternion.Inverse(lightRotation);
}
}
}
}

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/SunAngleRandomizer.cs.meta


fileFormatVersion: 2
guid: 8c42ca49e88d4572a27cf7326827d777
timeCreated: 1601672538

8
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/SunAngleRandomizerTag.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a SunAngleRandomizer to vary the rotation of directional lights
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/Sun Angle Randomizer Tag")]
public class SunAngleRandomizerTag : RandomizerTag { }
}

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/SunAngleRandomizerTag.cs.meta


fileFormatVersion: 2
guid: db00808ab9d04579b81b7f0dbd67b90f
timeCreated: 1601672735

8
com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalOptionElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement class="parameter__categorical-option">
<Button name="remove" class="randomization__remove-item-button"/>
<Label name="index-label" text="[0]" style="min-width: 50px;"/>
<editor:PropertyField name="option" class="parameter__categorical-option-property-field"/>
<editor:FloatField label="p:" name="probability" tooltip="Probability" class="randomization__collapsible-container" style="min-width: 40px; flex-grow: 0.15;"/>
</VisualElement>
</UXML>

12
com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalParameterTemplate.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<Toggle label="Uniform" name="uniform"/>
<editor:IntegerField label="Seed" name="seed"/>
<VisualElement class="parameter__categorical-options-list">
<ListView name="options"/>
</VisualElement>
<VisualElement style="flex-direction: row; justify-content: flex-end;">
<Button name="add-option" text="Add Option" class="parameter__categorical-options-list-button"/>
<Button name="add-folder" text="Add Folder" class="parameter__categorical-options-list-button"/>
<Button name="clear-options" text="Clear Options" class="parameter__categorical-options-list-button"/>
</VisualElement>
</UXML>

10
com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterDrawer.uxml


<UXML xmlns="UnityEngine.UIElements">
<VisualElement>
<Style src="../../Uss/Styles.uss"/>
<VisualElement style="flex-direction: row; align-items: center;">
<VisualElement name="collapse" class="randomization__collapse-toggle foldout-open"/>
<Label name="field-name" style="font-size: 12px;"/>
</VisualElement>
<VisualElement name="drawer" class="randomization__collapsible-container" style="padding-left: 18px;"/>
</VisualElement>
</UXML>

6
com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterElement.uxml


<UXML xmlns="UnityEngine.UIElements">
<VisualElement>
<Style src="../../Uss/Styles.uss"/>
<VisualElement name="properties"/>
</VisualElement>
</UXML>

10
com.unity.perception/Editor/Randomization/Uxml/Sampler/SamplerElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement name="sampler-template" style="margin-bottom: 4px;">
<Style src="../../Uss/Styles.uss"/>
<VisualElement style="flex-direction: row; align-items: center;">
<Label name="sampler-name" text="Sampler Name" class="unity-base-field__label"/>
<editor:ToolbarMenu name="sampler-type-dropdown" text="Placeholder Sampler Type" class="sampler__type-menu"/>
</VisualElement>
<VisualElement name="fields-container" style="margin-left: 18px;"/>
</VisualElement>
</UXML>

182
com.unity.perception/Documentation~/Randomization/Tutorial.md


# Randomization Tutorial
This goal of this tutorial is to walk users through an example randomized perception project that explores the following activities:
1. Creating a parameter configuration
2. Customizing parameters and samplers
4. Configuring a scenario to run the simulation
5. Configure the perception camera
6. Building a simulation runtime
7. Modifying scenario constants
By the end of this guide, the user should have a new project that generates the perception data necessary to train a model to identify a cube from a solid colored background.
Note: Before beginning the tutorial, follow [this guide](../SetupSteps.md) to install the perception package into a new Unity project.
## Step 1: Create Scene and GameObjects
1. Create a new scene using `File -> New Scene`
2. Use the key combo `Ctrl+S` to save and name the new scene
3. Create a new cube GameObject
1. Create a new cube GameObject by navigating to `GameObject -> 3D Object -> Cube` in the menubar
2. Rename the new cube GameObject "Cube" by double clicking on the new GameObject that appeared in the hierarchy
3. Reset the cube's transform component by right clicking on transform component in the cube's inpector and clicking `Reset`
4. Create a new background GameObject
1. Create a new quad GameObject and rename it "Background"
2. Set the background quad's position to (0, 0, 2) to set it behind the cube and make the quad large enough to fill the camera by change the quad's scale to (30, 30, 1)
5. In the *MeshRenderer* component of the *Cube* and *Background* GameObjects, set `Lighting -> Cast shadows -> Off` to prevent the two objects from casting shadows on each other
## Step 2: Create Parameter Configuration
1. Create a new empty GameObject by using `GameObject -> Create Empty` from the menubar
2. Rename the new empty GameObject "Config" by double clicking on the new GameObject that appeared in the hierarchy
3. To add a new Parameter Configuration component to the Config GameObject, click on the GameObject in the hierarchy and then click the `Add Component` button in the inspector window. Select `Randomization -> Parameter Configuration` to add the new component.
## Step 3: Create and Customize Parameters
In this step, we will configure 6 parameters to randomize the scene: *CubePosition*, *CubeRotation*, *CubeScale*, *CubeColor*, *BackgroundColor*, and *CameraRotation*
#### Parameter 1: Cube Position
1. Create a new Vector3 parameter by clicking *Add New Parameter -> Vector3* on the parameter configuration inspector
2. Rename the parameter "CubePosition" by typing the text box next to the blue text indicating the parameter's type
3. Click the *Target GameObject* checkbox and select the *Cube* GameObject in the target object selector. Select the property *position* from the property dropdown.
4. Consider using the following sampler values:
* X : Uniform [-5, 5]
* Y : Uniform [-5, 5]
* Z : Constant [Value = 0]
#### Parameter 2: Cube Rotation
1. Create a new Vector3 parameter named "CubeRotation"
2. Select the *Cube* GameObject as the target GameObject and select the property *Transform.eulerAngles* from the property dropdown
3. Consider using the following component values:
* X : Uniform [0, 360]
* Y : Uniform [0, 360]
* Z : Uniform [0, 360]
#### Parameter 3: Cube Scale
1. Create a new Vector3 parameter named "CubeScale"
2. Select the *Cube* GameObject as the target GameObject and select the property *Transform.localScale* from the property dropdown
3. Consider using the following component values:
* X : Uniform [0.5, 2]
* Y : Uniform [0.5, 2]
* Z : Uniform [0.5, 2]
4. To ensure that the X, Y, and Z samplers all sample equal scale values, copy the X sampler's random seed to all three samplers
#### Parameter 4: Cube Color
1. Create a new ColorHSVA parameter named "CubeColor"
2. Skip setting the target GameObject. We will be using this parameter from within the scenario instead.
3. Consider using the following component values:
* Hue : Uniform [0, 1]
* Saturation : Uniform [0, 1]
* Value : Uniform [0.25, 1]
* Alpha : Constant [Value = 0]
#### Parameter 5: Background Color
1. Create a new ColorHSVA parameter named "BackgroundColor"
2. Skip setting the target GameObject. We will be using this parameter from within the scenario instead.
3. Consider using the following component values:
* Hue : Uniform [0, 1]
* Saturation : Uniform [0, 1]
* Value : Uniform [0.25, 1]
* Alpha : Constant [Value = 0]
#### Parameter 6: Camera Rotation
1. Create a new Vector3 parameter named "CameraRotation"
2. Select the *Main Camera* GameObject as the target GameObject and select the property *Transform.eulerAngles* from the property dropdown
3. Consider using the following component values:
* X : Constant [Value = 0]
* Y : Constant [Value = 0]
* Z : Uniform [0, 360]
## Step 4: Configure Scenario
1. Right click on the *Scripts* folder in the project hierarchy and select `Create -> C# Script`. Name the script "CubeScenario" and press enter.
2. Double click on the new "CubeScenario" script to open it for edit
3. In your code editor, paste the following C# code into the CubeScenario script:
```
using System;
using UnityEngine;
using UnityEngine.Perception.Randomization.Configuration;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Scenarios;
public class CubeScenario : Scenario<CubeScenario.Constants>
{
[Serializable]
public class Constants
{
public int totalIterations = 1000;
}
public override bool isIterationComplete => currentIterationFrame >= 1;
public override bool isScenarioComplete => currentIteration >= constants.totalIterations;
public ParameterConfiguration config;
public GameObject background;
public GameObject cube;
ColorHsvaParameter m_BackgroundColorParameter;
ColorHsvaParameter m_CubeColorParameter;
Material m_BackgroundMaterial;
Material m_CubeMaterial;
static readonly int k_BaseColor = Shader.PropertyToID("_BaseColor");
public override void OnInitialize()
{
m_BackgroundColorParameter = config.GetParameter<ColorHsvaParameter>("BackgroundColor");
m_CubeColorParameter = config.GetParameter<ColorHsvaParameter>("CubeColor");
m_BackgroundMaterial = background.GetComponent<MeshRenderer>().material;
m_CubeMaterial = cube.GetComponent<MeshRenderer>().material;
}
public override void OnIterationSetup()
{
m_BackgroundMaterial.SetColor(k_BaseColor, m_BackgroundColorParameter.Sample());
m_CubeMaterial.SetColor(k_BaseColor, m_CubeColorParameter.Sample());
}
}
```
So what is this CubeScenario script accomplishing?
1. The *Constants* nested class in this scenario script determines what scenario parameters can be JSON serialized. Only these parameters can be changed externally from a built player. In this example, we expose the number of total iterations the scenario will complete.
2. The overrided properties *isIterationComplete* and *isScenarioComplete* are checked before every frame to control the scenario's execution flow. In this case, the scenario will execute for only one frame for each iteration and continue executing until reaching the total iteration limit set by the *totalIterations* field in the constants class.
3. In Unity, manipulating the color of a material is a shader specific task that cannot be accomplished directly from a color parameter's target GameObject setting. Instead we:
1. Expose a reference to the parameter configuration this scenario's inspector as the public script variable
2. Cache the ID of the *_BaseColor* shader property
3. Override the OnInitialize() method to cache a few references. First, we lookup the parameters *BackgroundColor* and *CubeColor* by name from the the parameter configuration. Second, we grab the references to the materials attached to the cube and background GameObjects when the simulation starts.
4. Override the OnIterationSetup() method to apply randomly sampled color values to the shaders of the cached materials at the beginning of each scenario iteration
4. Back in the Unity editor, navigate to the inspector of the *Config* GameObject and use `Add Component -> CubeScenario` to add the new CubeScenario component to your parameter configuration.
5. Open the constants dropdown and confirm how many iterations the scenario should run (the default is 1000)
6. Use the *backgroundColorParameter* and *cubeColorParameter* dropdowns to inform the script of which parameters in the configuration to use for the BackgroundColor and CubeColor respectively.
7. Select the *Background* and *Cube* GameObjects from their respective GameObject field selectors
8. Confirm that the scenario and parameter configuration are composed properly by clicking the play button in the editor. In the Game window, a cube of different sizes, rotations, scales, and colors should be appearing against a color changing background.
9. To serialize the constants used in the scenario to JSON for external modification after this project has been built into a runtime, click the *Serialize Config* button on the parameter configuration
## Step 5: Configure Perception Camera
Read through the [general perception getting started guide](../GettingStarted.md) before completing the following steps:
1. (For URP projects) Add GroundTruthRendererFeature
2. Add a *PerceptionCamera* component to the MainCamera
3. Label the cube
1. Add a *Labeling* component to the cube GameObject
2. Create a *LabelingConfiguration* asset
3. Add the cube label to the new configuration
4. Select the new configuration asset from the perception camera
4. Enter play mode to confirm that labeled data is being generated
## Step 6: Build Simulation Runtime
1. Create a new sub-folder under "Assets" in the Project Hierarchy named "BuildConfigurations"
2. Right click on the BuildConfigurations folder and use `Create -> Build -> Empty Build Configuration` to create a new build configuration asset
3. Rename the build configuration asset "TutorialBuild"
4. Copy the settings from the example build configuration screenshot below:
![TutorialBuild](Images/TutorialBuild.png)
5. Click the "Build" button in the upper righthand corner of the build configuration inspector to create an executable of the tutorial scene.
## Step 7: Modify Scenario Constants
**Note**: Make sure that the "Deserialize On Start" field is checked in the scenario's inspector. A player built without this field checked will cause the player to not load serialized constants.
1. Navigate to the folder created during the build from the previous step of this tutorial (example: C:\projects\RandomizationTutorial\Builds\Tutorial)
2. Open the "_Data" folder (example: Tutorial_Data) and then open the "StreamingAssets" folder
3. Inside the folder should be the JSON scenario constants serialized from the parameter configuration in Step 4
4. Edit this JSON file to update the scenario constants used in the player
5. Confirm the new constants are deserialized at runtime by executing the simulation

109
com.unity.perception/Editor/Randomization/Uss/ParameterStyles.uss


.randomizer-element {
border-width: 2px;
border-radius: 5px;
margin: 2px 1px;
background-color: #383838;
}
.parameter-type-label-container {
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 1px;
}
.parameter-type-label-box {
flex-direction: row;
align-items: center;
justify-content: flex-start;
flex-grow: 0;
-unity-text-align: middle-center;
border-width: 0;
padding: 1px;
font-size: 13px;
}
.parameter-type-label {
color: cornflowerblue;
-unity-text-align: middle-left;
margin-right: 4px;
}
.parameter-type-label-box .unity-base-text-field__input {
padding-left: 6px;
padding-right: 6px;
}
.collapse-toggle {
flex-shrink: 0;
margin-right: 3px;
margin-left: 3px;
width: 12px;
height: 12px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/FoldoutOpen.png");
}
.collapsed .collapse-toggle {
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/FoldoutClosed.png");
}
.collapsed .properties-container {
display: none;
}
.categorical-option {
flex-direction: row;
background-color: #3F3F3F;
margin: 1px;
border-radius: 4px;
}
.options-list-view {
background-color: #191919;
border-radius: 4px;
margin-right: 2px;
padding: 3px;
border-bottom-right-radius: 0;
}
.option-property-field {
width: 0;
flex-grow: 1;
flex-shrink: 0;
}
.uniform-probability .hide-when-uniform {
display: none;
}
.add-option-button {
align-self: flex-end;
border-width: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
background-color: #191919;
margin-top: 0;
margin-right: 2px;
}
.add-option-button:hover {
background-color: #2A2A2A;
}
.add-option-button:active {
color: cornflowerblue;
}
.remove-option-button {
width: 12px;
height: 14px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/X.png");
}
.drag-handle {
flex-shrink: 0;
width: 16px;
height: 100%;
min-height: 20px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/DragHandle.png");
}

8
com.unity.perception/Editor/Randomization/Uss/ParameterStyles.uss.meta


fileFormatVersion: 2
<<<<<<< HEAD
guid: 0a4e5cce05674cabb4e35dbba3176bb0
timeCreated: 1600754588
=======
guid: def81fa16f8b41aca393a30c3b1fac72
timeCreated: 1598222679
>>>>>>> 86d25d2... implemented parameter behaviours

16
com.unity.perception/Editor/Randomization/Uss/SamplerStyles.uss


.sampler-type-menu {
flex-grow: 1.5;
border-radius: 3px;
border-width: 1px;
margin-top: 2px;
margin-right: 3px;
}
.sampler-name {
/*color: lightgreen;*/
}
.float-range .unity-base-field__label {
min-width: auto;
margin-right: 4px;
}

8
com.unity.perception/Editor/Randomization/Uss/SamplerStyles.uss.meta


fileFormatVersion: 2
<<<<<<< HEAD
guid: f96184638ee64ea18b5e2d5c90f94c67
timeCreated: 1600754588
=======
guid: 85ff041b142f41798a7703bda9bb1ba7
timeCreated: 1598222791
>>>>>>> 86d25d2... implemented parameter behaviours

21
com.unity.perception/Editor/Randomization/Uss/ScenarioStyles.uss


.dark-viewport {
border-radius: 5px;
background-color: #191919;
padding: 2px;
}
.info-box {
border-width: 1px;
border-color: #191919;
padding: 2px 4px 2px 4px;
white-space: normal;
margin-top: 4px;
margin-bottom: 4px;
}
.drag-bar {
width: 100px;
height: 6px;
background-color: rgba(100,149,237,0.4);
position: absolute;
}

3
com.unity.perception/Editor/Randomization/Uss/ScenarioStyles.uss.meta


fileFormatVersion: 2
guid: 7db846b4c7cf420e8fdc32c7f701f5c3
timeCreated: 1600276536

3
com.unity.perception/Editor/Randomization/Uss/AddRandomizerMenuStyles.uss.meta


fileFormatVersion: 2
guid: 4315140b032047f8ad6bce89e3653dce
timeCreated: 1600837395

19
com.unity.perception/Editor/Randomization/Uss/AddRandomizerMenuStyles.uss


.menu-element {
padding: 2px 10px 2px 20px;
}
.chevron-right {
height: 12px;
width: 12px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/ChevronRight.png");
}
.chevron-left {
height: 12px;
width: 12px;
background-image: resource("Packages/com.unity.perception/Editor/Randomization/Icons/ChevronLeft.png");
}
.menu-element:hover {
background-color: #3E5F96;
}

8
com.unity.perception/Editor/Randomization/Uxml/CategoricalOptionElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement class="categorical-option">
<Button name="remove" class="remove-option-button"/>
<Label name="index-label" text="[0]" style="min-width: 50px;"/>
<editor:PropertyField name="option" class="option-property-field"/>
<editor:FloatField label="p:" name="probability" tooltip="Probability" class="hide-when-uniform" style="min-width: 40px; flex-grow: 0.15;"/>
</VisualElement>
</UXML>

12
com.unity.perception/Editor/Randomization/Uxml/CategoricalParameterTemplate.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<Toggle label="Uniform" name="uniform"/>
<editor:IntegerField label="Seed" name="seed"/>
<VisualElement class="options-list-view">
<ListView name="options"/>
</VisualElement>
<VisualElement style="flex-direction: row; justify-content: flex-end;">
<Button name="add-option" text="Add Option" class="add-option-button"/>
<Button name="add-folder" text="Add Folder" class="add-option-button"/>
<Button name="clear-options" text="Clear Options" class="add-option-button"/>
</VisualElement>
</UXML>

6
com.unity.perception/Editor/Randomization/Uxml/ParameterElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement>
<Style src="../Uss/ParameterStyles.uss"/>
<VisualElement name="properties"/>
</VisualElement>
</UXML>

10
com.unity.perception/Editor/Randomization/Uxml/SamplerElement.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement name="sampler-template" style="margin-bottom: 4px;">
<Style src="../Uss/SamplerStyles.uss"/>
<VisualElement style="flex-direction: row; align-items: center;">
<Label name="sampler-name" text="Sampler Name" class="unity-base-field__label sampler-name"/>
<editor:ToolbarMenu name="sampler-type-dropdown" text="Placeholder Sampler Type" class="sampler-type-menu"/>
</VisualElement>
<VisualElement name="fields-container" style="margin-left: 18px;"/>
</VisualElement>
</UXML>

10
com.unity.perception/Editor/Randomization/Uxml/ParameterDrawer.uxml


<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
<VisualElement>
<Style src="../Uss/ParameterStyles.uss"/>
<VisualElement style="flex-direction: row; align-items: center;">
<VisualElement name="collapse" class="collapse-toggle foldout-open"/>
<Label name="field-name" style="font-size: 12px;"/>
</VisualElement>
<VisualElement name="drawer" class="properties-container" style="padding-left: 18px;"/>
</VisualElement>
</UXML>

12
com.unity.perception/Editor/Randomization/VisualElements/ParameterDragBar.cs


using UnityEngine.UIElements;
namespace UnityEngine.Experimental.Perception.Randomization.Editor
{
class ParameterDragBar : VisualElement
{
public ParameterDragBar()
{
AddToClassList("drag-bar");
}
}
}

/com.unity.perception/Editor/Randomization/Uxml/CategoricalOptionElement.uxml.meta → /com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalOptionElement.uxml.meta

/com.unity.perception/Editor/Randomization/Uxml/CategoricalParameterTemplate.uxml.meta → /com.unity.perception/Editor/Randomization/Uxml/Parameter/CategoricalParameterTemplate.uxml.meta

/com.unity.perception/Editor/Randomization/Uxml/FloatRangeElement.uxml → /com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml

/com.unity.perception/Editor/Randomization/Uxml/FloatRangeElement.uxml.meta → /com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml.meta

/com.unity.perception/Editor/Randomization/Uxml/ParameterElement.uxml.meta → /com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterElement.uxml.meta

/com.unity.perception/Editor/Randomization/Uxml/SamplerElement.uxml.meta → /com.unity.perception/Editor/Randomization/Uxml/Sampler/SamplerElement.uxml.meta

/com.unity.perception/Editor/Randomization/Uxml/ParameterDrawer.uxml.meta → /com.unity.perception/Editor/Randomization/Uxml/Parameter/ParameterDrawer.uxml.meta

/com.unity.perception/Editor/Randomization/VisualElements/CategoricalOptionElement.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/ColorHsvaField.cs → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ColorHsvaField.cs

/com.unity.perception/Editor/Randomization/VisualElements/ColorHsvaField.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ColorHsvaField.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/DrawerParameterElement.cs → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs

/com.unity.perception/Editor/Randomization/VisualElements/DrawerParameterElement.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/FloatRangeElement.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/ParameterDragBar.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerReorderingIndicator.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/ParameterElement.cs → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs

/com.unity.perception/Editor/Randomization/VisualElements/ParameterElement.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/RandomSeedField.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Sampler/RandomSeedField.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/SamplerElement.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/CategoricalOptionElement.cs → /com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs

/com.unity.perception/Editor/Randomization/VisualElements/FloatRangeElement.cs → /com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs

/com.unity.perception/Editor/Randomization/VisualElements/RandomSeedField.cs → /com.unity.perception/Editor/Randomization/VisualElements/Sampler/RandomSeedField.cs

/com.unity.perception/Editor/Randomization/VisualElements/SamplerElement.cs → /com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs

/com.unity.perception/Editor/Randomization/VisualElements/DragToReorderManipulator.cs.meta → /com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs.meta

/com.unity.perception/Editor/Randomization/VisualElements/DragToReorderManipulator.cs → /com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs

正在加载...
取消
保存