浏览代码

preventing readonly fields and properties from being set

/main
Steven Leal 4 年前
当前提交
02d965ad
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2
      com.unity.perception/Documentation~/Randomization/Scenarios.md
  2. 4
      com.unity.perception/Editor/Randomization/ParameterElement.cs

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


6. **OnComplete** - actions to complete after the scenario as completed
## Constants
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 `FixedFrameLengthScenario` 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 used in the `FixedLengthScenario` class:
```
[Serializable]
public class Constants

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


var fieldInfos = componentType.GetFields();
foreach (var fieldInfo in fieldInfos)
{
if (fieldInfo.FieldType == propertyType)
if (fieldInfo.FieldType == propertyType && fieldInfo.IsPublic && !fieldInfo.IsInitOnly)
options.Add(new ParameterTarget()
{
gameObject = obj,

var propertyInfos = componentType.GetProperties();
foreach (var propertyInfo in propertyInfos)
{
if (propertyInfo.PropertyType == propertyType)
if (propertyInfo.PropertyType == propertyType && propertyInfo.GetSetMethod() != null)
options.Add(new ParameterTarget()
{
gameObject = obj,

正在加载...
取消
保存