浏览代码

Removed randomization tooling from the experimental namespace (#177)

* removed randomization tooling from the experimental namespace

* removed experimental namespace from randomization docs

* removed vestigial precompiled references from asmdefs

* added note to parameters doc

* added helpful link inside parameters doc

* fixed script name

* added MovedFrom attribute to randomization APIs
/main
GitHub 4 年前
当前提交
7cd80d5c
共有 102 个文件被更改,包括 316 次插入290 次删除
  1. 2
      README.md
  2. 3
      com.unity.perception/CHANGELOG.md
  3. 2
      com.unity.perception/Documentation~/Randomization/Index.md
  4. 10
      com.unity.perception/Documentation~/Randomization/Parameters.md
  5. 12
      com.unity.perception/Documentation~/Tutorial/Phase2.md
  6. 2
      com.unity.perception/Editor/Randomization/Editors/PerceptionEditorAnalytics.cs
  7. 4
      com.unity.perception/Editor/Randomization/Editors/RandomizerTagEditor.cs
  8. 4
      com.unity.perception/Editor/Randomization/Editors/RunInUnitySimulationWindow.cs
  9. 4
      com.unity.perception/Editor/Randomization/Editors/ScenarioBaseEditor.cs
  10. 4
      com.unity.perception/Editor/Randomization/PropertyDrawers/ColorHsvaDrawer.cs
  11. 4
      com.unity.perception/Editor/Randomization/PropertyDrawers/FloatRangeDrawer.cs
  12. 4
      com.unity.perception/Editor/Randomization/PropertyDrawers/ParameterDrawer.cs
  13. 4
      com.unity.perception/Editor/Randomization/PropertyDrawers/SamplerDrawer.cs
  14. 2
      com.unity.perception/Editor/Randomization/Utilities/ParameterUIElementsEditor.cs
  15. 6
      com.unity.perception/Editor/Randomization/Utilities/StaticData.cs
  16. 2
      com.unity.perception/Editor/Randomization/Utilities/UIElementsEditorUtilities.cs
  17. 2
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/CategoricalOptionElement.cs
  18. 4
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/ColorHsvaField.cs
  19. 2
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/DrawerParameterElement.cs
  20. 4
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs
  21. 4
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/AddRandomizerMenu.cs
  22. 4
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/DragToReorderManipulator.cs
  23. 4
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerElement.cs
  24. 4
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerList.cs
  25. 2
      com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerReorderingIndicator.cs
  26. 2
      com.unity.perception/Editor/Randomization/VisualElements/Sampler/FloatRangeElement.cs
  27. 2
      com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerElement.cs
  28. 4
      com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerInterfaceElement.cs
  29. 19
      com.unity.perception/Editor/Unity.Perception.Editor.asmdef
  30. 6
      com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs
  31. 4
      com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameterBase.cs
  32. 7
      com.unity.perception/Runtime/Randomization/Parameters/NumericParameter.cs
  33. 6
      com.unity.perception/Runtime/Randomization/Parameters/Parameter.cs
  34. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/AnimationClipParameter.cs
  35. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/GameObjectParameter.cs
  36. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/MaterialParameter.cs
  37. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/StringParameter.cs
  38. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/Texture2DParameter.cs
  39. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/BooleanParameter.cs
  40. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorHsva.cs
  41. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorHsvaCategoricalParameter.cs
  42. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorHsvaParameter.cs
  43. 4
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorRgbCategoricalParameter.cs
  44. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorRgbParameter.cs
  45. 8
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/FloatParameter.cs
  46. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/IntegerParameter.cs
  47. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/Vector2Parameter.cs
  48. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/Vector3Parameter.cs
  49. 9
      com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/Vector4Parameter.cs
  50. 2
      com.unity.perception/Runtime/Randomization/Parameters/ParameterValidationException.cs
  51. 4
      com.unity.perception/Runtime/Randomization/Randomizers/AddRandomizerMenuAttribute.cs
  52. 9
      com.unity.perception/Runtime/Randomization/Randomizers/Randomizer.cs
  53. 8
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/AnimationRandomizer.cs
  54. 8
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/BackgroundObjectPlacementRandomizer.cs
  55. 6
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/ColorRandomizer.cs
  56. 7
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/ForegroundObjectPlacementRandomizer.cs
  57. 8
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/HueOffsetRandomizer.cs
  58. 8
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/RotationRandomizer.cs
  59. 8
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/SunAngleRandomizer.cs
  60. 6
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/TextureRandomizer.cs
  61. 4
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/AnimationRandomizerTag.cs
  62. 2
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/ColorRandomizerTag.cs
  63. 2
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/HueOffsetRandomizerTag.cs
  64. 2
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/RotationRandomizerTag.cs
  65. 2
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/SunAngleRandomizerTag.cs
  66. 2
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/TextureRandomizerTag.cs
  67. 120
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Utilities/GameObjectOneWayCache.cs
  68. 4
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Utilities/PoissonDiskSampling.cs
  69. 4
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTag.cs
  70. 6
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTagManager.cs
  71. 4
      com.unity.perception/Runtime/Randomization/Samplers/FloatRange.cs
  72. 4
      com.unity.perception/Runtime/Randomization/Samplers/ISampler.cs
  73. 2
      com.unity.perception/Runtime/Randomization/Samplers/SamplerState.cs
  74. 10
      com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/AnimationCurveSampler.cs
  75. 7
      com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/ConstantSampler.cs
  76. 8
      com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/NormalSampler.cs
  77. 9
      com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/UniformSampler.cs
  78. 2
      com.unity.perception/Runtime/Randomization/Samplers/SamplerUtility.cs
  79. 2
      com.unity.perception/Runtime/Randomization/Samplers/SamplerValidationException.cs
  80. 4
      com.unity.perception/Runtime/Randomization/Scenarios/FixedLengthScenario.cs
  81. 10
      com.unity.perception/Runtime/Randomization/Scenarios/Scenario.cs
  82. 10
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs
  83. 6
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioConstants.cs
  84. 2
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioException.cs
  85. 4
      com.unity.perception/Runtime/Randomization/Scenarios/UnitySimulationScenario.cs
  86. 4
      com.unity.perception/Runtime/Randomization/Scenarios/UnitySimulationScenarioConstants.cs
  87. 8
      com.unity.perception/Runtime/Unity.Perception.Runtime.asmdef
  88. 4
      com.unity.perception/Tests/Editor/RandomizerEditorTests.cs
  89. 2
      com.unity.perception/Tests/Runtime/Randomization/ParameterTests/CategoricalParameterTests.cs
  90. 2
      com.unity.perception/Tests/Runtime/Randomization/ParameterTests/GenericParameterTests.cs
  91. 4
      com.unity.perception/Tests/Runtime/Randomization/ParameterTests/StructParameterTests.cs
  92. 4
      com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/ExampleTransformRandomizer.cs
  93. 4
      com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTagTests.cs
  94. 2
      com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTests.cs
  95. 2
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/AnimationCurveSamplerTests.cs
  96. 2
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/ConstantSamplerTests.cs
  97. 2
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/FloatRangeTests.cs
  98. 2
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/NormalSamplerTests.cs
  99. 4
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerTestsBase.cs
  100. 2
      com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerUtilityTests.cs

2
README.md


|[Label Config](com.unity.perception/Documentation~/GroundTruthLabeling.md#label-config)|An asset that defines a taxonomy of labels for ground truth generation|
|[Perception Camera](com.unity.perception/Documentation~/PerceptionCamera.md)|Captures RGB images and ground truth from a [Camera](https://docs.unity3d.com/Manual/class-Camera.html).|
|[Dataset Capture](com.unity.perception/Documentation~/DatasetCapture.md)|Ensures sensors are triggered at proper rates and accepts data for the JSON dataset.|
|[Randomization (Experimental)](com.unity.perception/Documentation~/Randomization/Index.md)|The Randomization tool set lets you integrate domain randomization principles into your simulation.|
|[Randomization](com.unity.perception/Documentation~/Randomization/Index.md)|The Randomization tool set lets you integrate domain randomization principles into your simulation.|
## Example Projects

3
com.unity.perception/CHANGELOG.md


Removed `range` as a required ISampler interface property.
Removed randomization tooling from the "Experimental" namespace
### Fixed
Fixed an issue where the overlay panel would display a full screen semi-transparent image over the entire screen when the overlay panel is disabled in the UI

### Removed
### Fixed
UnitySimulationScenario now correctly deserializes app-params before offsetting the current scenario iteration when executing on Unity Simulation.

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


# Overview
*NOTE: The Perception package's randomization toolset is currently marked as experimental and is subject to change.*
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?

10
com.unity.perception/Documentation~/Randomization/Parameters.md


## Using Parameters outside of Randomizers (ie: in MonoBehaviours and ScriptableObjects)
After adding a public Parameter field to a MonoBehaviour or ScriptableObject, you may have noticed that the Parameter's UI doesn't look the same as it does when added to a Randomizer. This is because the Inspector UI for most Perception randomization components is authored using Unity's relatively new UI Elements framework, though by default, Unity uses the old IMGUI framework to render default inspector editors.
After adding a public Parameter field to a MonoBehaviour or ScriptableObject, you may have noticed that the Parameter's UI does not look the same as it does when added to a Randomizer. This is because the Inspector UI for most Perception randomization components is authored using Unity's relatively new UI Elements framework, though by default, Unity uses the old IMGUI framework to render default inspector editors.
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
public class CustomMonoBehaviour : MonoBehaviour
{

```
using UnityEditor;
using UnityEngine.Experimental.Perception.Editor;
using UnityEngine.Perception.Editor;
public class TestClusterEditor : DefaultUIElementsEditor { }
public class CustomMonoBehaviourEditor : ParameterUIElementsEditor { }
**_Note_**: Any editor scripts must be placed inside an "Editor" folder within your project. "Editor" is a [special folder name](https://docs.unity3d.com/Manual/SpecialFolders.html) in Unity that prevents editor code from compiling into a player during the build process. For example, the file path for the CustomMonoBehaviourEditor script above could be ".../Assets/Scripts/Editor/CustomMonoBehaviourEditor".
### Categorical Parameters

12
com.unity.perception/Documentation~/Tutorial/Phase2.md


```C#
using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers;
[Serializable]
[AddRandomizerMenu("Perception/My Light Randomizer")]

```C#
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Randomizers;
[AddComponentMenu("Perception/RandomizerTags/MyLightRandomizerTag")]
[RequireComponent(typeof(Light))]

* **:green_circle: Action**: Open `MyLightRandomizerTag.cs` and modify it to match the code below:
```C#
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Randomizers;
[AddComponentMenu("Perception/RandomizerTags/MyLightRandomizerTag")]
[RequireComponent(typeof(Light))]

```C#
using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers;
[Serializable]
[AddRandomizerMenu("Perception/My Light Randomizer")]

2
com.unity.perception/Editor/Randomization/Editors/PerceptionEditorAnalytics.cs


using JetBrains.Annotations;
using UnityEngine.Analytics;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
static class PerceptionEditorAnalytics
{

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


using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Randomizers;
namespace UnityEngine.Experimental.Perception.Randomization.Editor
namespace UnityEngine.Perception.Randomization.Editor
{
[CustomEditor(typeof(RandomizerTag), true)]
public class RandomizerTagEditor : UnityEditor.Editor

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


using UnityEditor.Build.Reporting;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Scenarios;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class RunInUnitySimulationWindow : EditorWindow
{

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


using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Scenarios;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
[CustomEditor(typeof(ScenarioBase), true)]
class ScenarioBaseEditor : Editor

4
com.unity.perception/Editor/Randomization/PropertyDrawers/ColorHsvaDrawer.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace UnityEditor.Experimental.Perception.Randomization.PropertyDrawers
namespace UnityEditor.Perception.Randomization.PropertyDrawers
{
[CustomPropertyDrawer(typeof(ColorHsva), true)]
class ColorHsvaDrawer : PropertyDrawer

4
com.unity.perception/Editor/Randomization/PropertyDrawers/FloatRangeDrawer.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEditor.Experimental.Perception.Randomization.PropertyDrawers
namespace UnityEditor.Perception.Randomization.PropertyDrawers
{
[CustomPropertyDrawer(typeof(FloatRange))]
class FloatRangeDrawer : PropertyDrawer

4
com.unity.perception/Editor/Randomization/PropertyDrawers/ParameterDrawer.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace UnityEditor.Experimental.Perception.Randomization.PropertyDrawers
namespace UnityEditor.Perception.Randomization.PropertyDrawers
{
[CustomPropertyDrawer(typeof(Parameter), true)]
class ParameterDrawer : PropertyDrawer

4
com.unity.perception/Editor/Randomization/PropertyDrawers/SamplerDrawer.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEditor.Experimental.Perception.Randomization.PropertyDrawers
namespace UnityEditor.Perception.Randomization.PropertyDrawers
{
[CustomPropertyDrawer(typeof(ISampler), true)]
class SamplerDrawer : PropertyDrawer

2
com.unity.perception/Editor/Randomization/Utilities/ParameterUIElementsEditor.cs


using UnityEngine;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
/// <summary>
/// Derive this class to force the Unity Editor to render the default inspector using UIElements for an Object that

6
com.unity.perception/Editor/Randomization/Utilities/StaticData.cs


using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
static class StaticData
{

2
com.unity.perception/Editor/Randomization/Utilities/UIElementsEditorUtilities.cs


using UnityEngine;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
/// <summary>
/// This class contains a set of helper functions for simplifying the creation of UI Elements editors

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


using UnityEngine;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class CategoricalOptionElement : VisualElement
{

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


using System;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class ColorHsvaField : ColorField
{

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


using System;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class DrawerParameterElement : VisualElement
{

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


using System.Collections.Generic;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class ParameterElement : VisualElement
{

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


using System.Collections.Generic;
using NUnit.Framework;
using Unity.Mathematics;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Randomizers;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class AddRandomizerMenu : VisualElement
{

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


using System;
using UnityEditor.Experimental.Perception.Randomization;
using UnityEditor.Perception.Randomization;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class DragToReorderManipulator : MouseManipulator
{

4
com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerElement.cs


using System;
using UnityEditor.UIElements;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Randomizers;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class RandomizerElement : VisualElement
{

4
com.unity.perception/Editor/Randomization/VisualElements/Randomizer/RandomizerList.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Scenarios;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class RandomizerList : VisualElement
{

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


using System;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class RandomizerReorderingIndicator : VisualElement
{

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


using UnityEngine;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class FloatRangeElement : VisualElement
{

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


using System;
using UnityEngine.UIElements;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class SamplerElement : VisualElement
{

4
com.unity.perception/Editor/Randomization/VisualElements/Sampler/SamplerInterfaceElement.cs


using System;
using UnityEditor.UIElements;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEditor.Experimental.Perception.Randomization
namespace UnityEditor.Perception.Randomization
{
class SamplerInterfaceElement : VisualElement
{

19
com.unity.perception/Editor/Unity.Perception.Editor.asmdef


{
"name": "Unity.Perception.Editor",
"rootNamespace": "",
"Unity.Collections",
"Unity.Entities",
"Unity.Mathematics",
"Unity.Perception.Runtime",
"Unity.RenderPipelines.HighDefinition.Runtime",
"Unity.Mathematics",
"Unity.Entities",
"Unity.Collections",
"Unity.Perception.Runtime",
"PathCreatorEditor",
"PathCreator",
"UnityEngine.UI",
"Unity.Simulation.Client.Editor"
"Unity.RenderPipelines.HighDefinition.Runtime",
"Unity.Simulation.Client.Editor",
"UnityEngine.UI"
],
"includePlatforms": [
"Editor"

}
],
"noEngineReferences": false
}
}

6
com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs


using System;
using System.Collections.Generic;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
{
/// <summary>
/// Generates samples by choosing one option from a list of choices

[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public abstract class CategoricalParameter<T> : CategoricalParameterBase
{
[SerializeField] internal bool uniform = true;

4
com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameterBase.cs


using System;
using System.Collections.Generic;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public abstract class CategoricalParameterBase : Parameter
{
[SerializeField] internal List<float> probabilities = new List<float>();

7
com.unity.perception/Runtime/Randomization/Parameters/NumericParameter.cs


using System;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
{
/// <summary>
/// Numeric parameters use samplers to generate randomized structs

[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public abstract class NumericParameter<T> : Parameter where T : struct
{
/// <summary>

6
com.unity.perception/Runtime/Randomization/Parameters/Parameter.cs


using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
{
/// <summary>
/// Parameters, in conjunction with a parameter configuration, are used to create convenient interfaces for

[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public abstract class Parameter
{
[HideInInspector, SerializeField] internal bool collapsed;

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/AnimationClipParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class AnimationClipParameter : CategoricalParameter<AnimationClip> { }
}

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/GameObjectParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class GameObjectParameter : CategoricalParameter<GameObject> { }
}

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/MaterialParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class MaterialParameter : CategoricalParameter<Material> {}
}

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/StringParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class StringParameter : CategoricalParameter<string> {}
}

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/Texture2DParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class Texture2DParameter : CategoricalParameter<Texture2D> { }
}

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/BooleanParameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class BooleanParameter : NumericParameter<bool>
{
/// <summary>

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorHsva.cs


using System;
using Unity.Mathematics;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public struct ColorHsva
{
/// <summary>

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorHsvaCategoricalParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class ColorHsvaCategoricalParameter : CategoricalParameter<ColorHsva> { }
}

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorHsvaParameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class ColorHsvaParameter : NumericParameter<Color>
{
/// <summary>

4
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorRgbCategoricalParameter.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class ColorRgbCategoricalParameter : CategoricalParameter<Color> { }
}

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/ColorParameters/ColorRgbParameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class ColorRgbParameter : NumericParameter<Color>
{
/// <summary>

8
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/FloatParameter.cs


using System;
using System.Collections.Generic;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class FloatParameter : NumericParameter<float>
{
/// <summary>

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/IntegerParameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class IntegerParameter : NumericParameter<int>
{
/// <summary>

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/Vector2Parameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class Vector2Parameter : NumericParameter<Vector2>
{
/// <summary>

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/Vector3Parameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class Vector3Parameter : NumericParameter<Vector3>
{
/// <summary>

9
com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/NumericParameters/Vector4Parameter.cs


using System;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public class Vector4Parameter : NumericParameter<Vector4>
{
/// <summary>

2
com.unity.perception/Runtime/Randomization/Parameters/ParameterValidationException.cs


using System;
namespace UnityEngine.Experimental.Perception.Randomization.Parameters
namespace UnityEngine.Perception.Randomization.Parameters
{
class ParameterValidationException : Exception
{

4
com.unity.perception/Runtime/Randomization/Randomizers/AddRandomizerMenuAttribute.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers
namespace UnityEngine.Perception.Randomization.Randomizers
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Randomizers")]
public class AddRandomizerMenuAttribute : Attribute
{
/// <summary>

9
com.unity.perception/Runtime/Randomization/Randomizers/Randomizer.cs


using System;
using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Scenarios;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers
namespace UnityEngine.Perception.Randomization.Randomizers
{
/// <summary>
/// Derive Randomizer to implement systems that randomize GameObjects and/or simulation properties.

/// https://issuetracker.unity3d.com/issues/serializereference-non-serialized-initialized-fields-lose-their-values-when-entering-play-mode
/// </remark>
[Serializable]
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Randomizers")]
public abstract class Randomizer
{
bool m_PreviouslyEnabled;

8
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/AnimationRandomizer.cs


using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Chooses a random of frame of a random clip for a game object

8
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/BackgroundObjectPlacementRandomizer.cs


using System;
using System.Collections.Generic;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.Utilities;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Creates multiple layers of evenly distributed but randomly placed objects

6
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/ColorRandomizer.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the material color of objects tagged with a ColorRandomizerTag

7
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/ForegroundObjectPlacementRandomizer.cs


using System;
using System.Linq;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.Utilities;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Creates a 2D layer of of evenly spaced GameObjects from a given list of prefabs

8
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/HueOffsetRandomizer.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomly offsets the hue of objects tagged with a ColorRandomizerTag

8
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/RotationRandomizer.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the rotation of objects tagged with a RotationRandomizerTag

8
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/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;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Perception.Randomization.Samplers;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the rotation of directional lights tagged with a SunAngleRandomizerTag

6
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/TextureRandomizer.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the material texture of objects tagged with a TextureRandomizerTag

4
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/AnimationRandomizerTag.cs


using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a <see cref="AnimationRandomizer"/> to select a random animation frame for

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


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a ColorRandomizer to vary the material color of GameObjects

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


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a HueOffsetRandomizer to vary the hue of GameObjects

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


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a RotationRandomizer to vary the rotation of GameObjects

2
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/SunAngleRandomizerTag.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a SunAngleRandomizer to vary the rotation of directional lights

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


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
namespace UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a TextureRandomizer to vary the material texture of GameObjects

120
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Utilities/GameObjectOneWayCache.cs


using System.Collections.Generic;
using Unity.Profiling;
using UnityEngine;
using Object = UnityEngine.Object;
/// <summary>
/// Facilitates object pooling for a pre-specified collection of prefabs with the caveat that objects can be fetched
/// from the cache but not returned. Every frame, the cache needs to be reset, which will return all objects to the pool
/// </summary>
class GameObjectOneWayCache
namespace UnityEngine.Perception.Randomization.Randomizers.Utilities
static ProfilerMarker s_ResetAllObjectsMarker = new ProfilerMarker("ResetAllObjects");
// Objects will reset to this origin when not being used
Transform m_CacheParent;
Dictionary<int, int> m_InstanceIdToIndex;
List<GameObject>[] m_InstantiatedObjects;
int[] m_NumObjectsActive;
int NumObjectsInCache { get; set; }
public int NumObjectsActive { get; private set; }
public GameObjectOneWayCache(Transform parent, GameObject[] prefabs)
/// <summary>
/// Facilitates object pooling for a pre-specified collection of prefabs with the caveat that objects can be fetched
/// from the cache but not returned. Every frame, the cache needs to be reset, which will return all objects to the pool
/// </summary>
class GameObjectOneWayCache
m_CacheParent = parent;
m_InstanceIdToIndex = new Dictionary<int, int>();
m_InstantiatedObjects = new List<GameObject>[prefabs.Length];
m_NumObjectsActive = new int[prefabs.Length];
var index = 0;
foreach (var prefab in prefabs)
{
var instanceId = prefab.GetInstanceID();
m_InstanceIdToIndex.Add(instanceId, index);
m_InstantiatedObjects[index] = new List<GameObject>();
m_NumObjectsActive[index] = 0;
++index;
}
}
static ProfilerMarker s_ResetAllObjectsMarker = new ProfilerMarker("ResetAllObjects");
public GameObject GetOrInstantiate(GameObject prefab)
{
if (!m_InstanceIdToIndex.TryGetValue(prefab.GetInstanceID(), out var index))
{
throw new ArgumentException($"Prefab {prefab.name} (ID: {prefab.GetInstanceID()}) is not in cache.");
}
// Objects will reset to this origin when not being used
Transform m_CacheParent;
Dictionary<int, int> m_InstanceIdToIndex;
List<GameObject>[] m_InstantiatedObjects;
int[] m_NumObjectsActive;
int NumObjectsInCache { get; set; }
public int NumObjectsActive { get; private set; }
++NumObjectsActive;
if (m_NumObjectsActive[index] < m_InstantiatedObjects[index].Count)
public GameObjectOneWayCache(Transform parent, GameObject[] prefabs)
var nextInCache = m_InstantiatedObjects[index][m_NumObjectsActive[index]];
++m_NumObjectsActive[index];
return nextInCache;
m_CacheParent = parent;
m_InstanceIdToIndex = new Dictionary<int, int>();
m_InstantiatedObjects = new List<GameObject>[prefabs.Length];
m_NumObjectsActive = new int[prefabs.Length];
var index = 0;
foreach (var prefab in prefabs)
{
var instanceId = prefab.GetInstanceID();
m_InstanceIdToIndex.Add(instanceId, index);
m_InstantiatedObjects[index] = new List<GameObject>();
m_NumObjectsActive[index] = 0;
++index;
}
else
public GameObject GetOrInstantiate(GameObject prefab)
++NumObjectsInCache;
var newObject = Object.Instantiate(prefab, m_CacheParent);
++m_NumObjectsActive[index];
m_InstantiatedObjects[index].Add(newObject);
return newObject;
if (!m_InstanceIdToIndex.TryGetValue(prefab.GetInstanceID(), out var index))
{
throw new ArgumentException($"Prefab {prefab.name} (ID: {prefab.GetInstanceID()}) is not in cache.");
}
++NumObjectsActive;
if (m_NumObjectsActive[index] < m_InstantiatedObjects[index].Count)
{
var nextInCache = m_InstantiatedObjects[index][m_NumObjectsActive[index]];
++m_NumObjectsActive[index];
return nextInCache;
}
else
{
++NumObjectsInCache;
var newObject = Object.Instantiate(prefab, m_CacheParent);
++m_NumObjectsActive[index];
m_InstantiatedObjects[index].Add(newObject);
return newObject;
}
}
public void ResetAllObjects()
{
using (s_ResetAllObjectsMarker.Auto())
public void ResetAllObjects()
NumObjectsActive = 0;
for (var i = 0; i < m_InstantiatedObjects.Length; ++i)
using (s_ResetAllObjectsMarker.Auto())
m_NumObjectsActive[i] = 0;
foreach (var obj in m_InstantiatedObjects[i])
NumObjectsActive = 0;
for (var i = 0; i < m_InstantiatedObjects.Length; ++i)
// Position outside the frame
obj.transform.localPosition = new Vector3(10000, 0, 0);
m_NumObjectsActive[i] = 0;
foreach (var obj in m_InstantiatedObjects[i])
{
// Position outside the frame
obj.transform.localPosition = new Vector3(10000, 0, 0);
}
}
}
}

4
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Utilities/PoissonDiskSampling.cs


using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
namespace UnityEngine.Perception.Randomization.Randomizers.Utilities
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers")]
public static class PoissonDiskSampling
{
const int k_DefaultSamplingResolution = 30;

4
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTag.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers
namespace UnityEngine.Perception.Randomization.Randomizers
{
/// <summary>
/// Derive the RandomizerTag class to create new tag components.

[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Randomizers")]
public abstract class RandomizerTag : MonoBehaviour
{
RandomizerTagManager tagManager => RandomizerTagManager.singleton;

6
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTagManager.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.Entities;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Randomizers
namespace UnityEngine.Perception.Randomization.Randomizers
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Randomizers")]
public class RandomizerTagManager
{
/// <summary>

4
com.unity.perception/Runtime/Randomization/Samplers/FloatRange.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Samplers")]
public struct FloatRange
{
/// <summary>

4
com.unity.perception/Runtime/Randomization/Samplers/ISampler.cs


using System;
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Samplers")]
public interface ISampler
{
/// <summary>

2
com.unity.perception/Runtime/Randomization/Samplers/SamplerState.cs


namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
{
/// <summary>
/// Encapsulates the random state that all samplers mutate when generating random values

10
com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/AnimationCurveSampler.cs


using System;
using System.Runtime.CompilerServices;
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
{
/// <summary>
/// Returns random values according to a range and probability distribution denoted by a user provided AnimationCurve.

/// The Y values cannot however be negative.
/// </summary>
[Serializable]
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Samplers")]
public class AnimationCurveSampler : ISampler
{
/// <summary>

7
com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/ConstantSampler.cs


using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Samplers")]
public class ConstantSampler : ISampler
{
/// <summary>

8
com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/NormalSampler.cs


using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
{
/// <summary>
/// Returns normally distributed random values bounded within a specified range

[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Samplers")]
public class NormalSampler : ISampler
{
/// <summary>

9
com.unity.perception/Runtime/Randomization/Samplers/SamplerTypes/UniformSampler.cs


using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Samplers")]
public class UniformSampler : ISampler
{
/// <summary>

2
com.unity.perception/Runtime/Randomization/Samplers/SamplerUtility.cs


using Unity.Collections;
using Unity.Mathematics;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
{
/// <summary>
/// A set of utility functions for defining sampler interfaces

2
com.unity.perception/Runtime/Randomization/Samplers/SamplerValidationException.cs


using System;
namespace UnityEngine.Experimental.Perception.Randomization.Samplers
namespace UnityEngine.Perception.Randomization.Samplers
{
class SamplerValidationException : Exception
{

4
com.unity.perception/Runtime/Randomization/Scenarios/FixedLengthScenario.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Scenarios")]
public class FixedLengthScenario: UnitySimulationScenario<FixedLengthScenario.Constants>
{
/// <summary>

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


using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Scenarios")]
public abstract class Scenario<T> : ScenarioBase where T : ScenarioConstants, new()
{
/// <summary>

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


using System.IO;
using Unity.Simulation;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Scenarios")]
public abstract class ScenarioBase : MonoBehaviour
{
static ScenarioBase s_ActiveScenario;

6
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioConstants.cs


using System;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Scenarios")]
public class ScenarioConstants
{
/// <summary>

2
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioException.cs


using System;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
{
[Serializable]
class ScenarioException : Exception

4
com.unity.perception/Runtime/Randomization/Scenarios/UnitySimulationScenario.cs


using System;
using Unity.Simulation;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Scenarios")]
public abstract class UnitySimulationScenario<T> : Scenario<T> where T : UnitySimulationScenarioConstants, new()
{
/// <inheritdoc/>

4
com.unity.perception/Runtime/Randomization/Scenarios/UnitySimulationScenarioConstants.cs


using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Perception.Randomization.Scenarios
namespace UnityEngine.Perception.Randomization.Scenarios
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Scenarios")]
public class UnitySimulationScenarioConstants : ScenarioConstants
{
/// <summary>

8
com.unity.perception/Runtime/Unity.Perception.Runtime.asmdef


"Unity.RenderPipelines.Core.Runtime",
"Unity.RenderPipelines.HighDefinition.Runtime",
"Unity.RenderPipelines.Universal.Runtime",
"Unity.Simulation.Core",
"PathCreator"
"Unity.Simulation.Core"
],
"includePlatforms": [],
"excludePlatforms": [],

"Newtonsoft.Json.dll",
"QuickGraph.dll"
"Newtonsoft.Json.dll"
],
"autoReferenced": true,
"defineConstraints": [],

}
],
"noEngineReferences": false
}
}

4
com.unity.perception/Tests/Editor/RandomizerEditorTests.cs


using System;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Scenarios;
using Object = UnityEngine.Object;
namespace EditorTests

2
com.unity.perception/Tests/Runtime/Randomization/ParameterTests/CategoricalParameterTests.cs


using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace RandomizationTests.ParameterTests
{

2
com.unity.perception/Tests/Runtime/Randomization/ParameterTests/GenericParameterTests.cs


using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Parameters;
namespace RandomizationTests.ParameterTests
{

4
com.unity.perception/Tests/Runtime/Randomization/ParameterTests/StructParameterTests.cs


using System;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Scenarios;
using Object = UnityEngine.Object;
namespace RandomizationTests.ParameterTests

4
com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/ExampleTransformRandomizer.cs


using System;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Parameters;
using UnityEngine.Perception.Randomization.Randomizers;
namespace RandomizationTests.RandomizerTests
{

4
com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTagTests.cs


using System.Linq;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Randomizers;
using UnityEngine.Perception.Randomization.Scenarios;
using Assert = Unity.Assertions.Assert;
namespace RandomizationTests.RandomizerTests

2
com.unity.perception/Tests/Runtime/Randomization/RandomizerTests/RandomizerTests.cs


using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Scenarios;
using UnityEngine.TestTools;
namespace RandomizationTests.RandomizerTests

2
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/AnimationCurveSamplerTests.cs


using NUnit.Framework;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace RandomizationTests.SamplerTests
{

2
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/ConstantSamplerTests.cs


using NUnit.Framework;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace RandomizationTests.SamplerTests
{

2
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/FloatRangeTests.cs


using System;
using NUnit.Framework;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace RandomizationTests.SamplerTests
{

2
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/NormalSamplerTests.cs


using NUnit.Framework;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace RandomizationTests.SamplerTests
{

4
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerTestsBase.cs


using NUnit.Framework;
using Unity.Jobs;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Experimental.Perception.Randomization.Scenarios;
using UnityEngine.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Scenarios;
using Object = UnityEngine.Object;
namespace RandomizationTests.SamplerTests

2
com.unity.perception/Tests/Runtime/Randomization/SamplerTests/SamplerUtilityTests.cs


using NUnit.Framework;
using UnityEngine.Experimental.Perception.Randomization.Samplers;
using UnityEngine.Perception.Randomization.Samplers;
namespace RandomizationTests.SamplerTests
{

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存