浏览代码

added docs and updated the changelog

/main
Steven Leal 4 年前
当前提交
25b52917
共有 2 个文件被更改,包括 16 次插入1 次删除
  1. 1
      com.unity.perception/CHANGELOG.md
  2. 16
      com.unity.perception/Documentation~/Randomization/Parameters.md

1
com.unity.perception/CHANGELOG.md


Added AnimationCurveSampler, which returns random values according to a range and probability distribution denoted by a user provided AnimationCurve.
Added DefaultUIElementsEditor class to allow custom ScriptableObjects to render Parameter and Sampler typed public fields correctly in their inspector windows
### Changed

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


1. `CategoricalParameter`
2. `NumericParameter`
## Using Parameters outside of Randomizers (ie: in MonoBehaviours and ScriptableObjects)
After adding a public Parameter field to a Monobehavior or ScriptableObject, you may have noticed that the parameter's UI doesn't look the same as it does on when added to a Randomizer. This is because the Inspector UI for most Perception randomization components are authored using Unity's relatively new UI Elements framework, though by default, Unity uses the old IMGUI framework to render default inspector editors.
To force Unity to use UI Elements to render your CustomMonoBehaviour's inspector window, create a custom inspector for your Monobehaviour by deriving the DefaultUIElementsEditor class like so:
```
using UnityEditor;
using UnityEngine.Experimental.Perception.Editor;
[CustomEditor(typeof(CustomMonoBehaviour))]
public class TestClusterEditor : DefaultUIElementsEditor { }
```
### Categorical Parameters
Categorical parameters choose a value from a list of options that have no intrinsic ordering. For example, a material paramater randomly chooses from a list of material options, but the list of material options itself can be rearranged into any particular order without affecting the distribution of materials selected.

### Numeric Parameters
Numeric parameters use samplers to generate randomized structs. Take a look at the [ColorHsvaParameter]() class included in the perception package for an example on how to implement a numeric parameter.
Numeric parameters use samplers to generate randomized structs. Take a look at the [ColorHsvaParameter]() class included in the perception package for an example on how to implement a numeric parameter.
正在加载...
取消
保存