比较提交

...
此合并请求有变更与目标分支冲突。
/com.unity.perception/CHANGELOG.md

3 次代码提交

共有 4 个文件被更改,包括 19 次插入13 次删除
  1. 7
      com.unity.perception/Tests/Runtime/Randomization/ScenarioTests/Resources/SampleScenarioConfiguration.json
  2. 18
      com.unity.perception/Runtime/Randomization/Scenarios/Serialization/ScenarioSerializer.cs
  3. 3
      com.unity.perception/Runtime/Randomization/Scenarios/Serialization/SerializationStructures.cs
  4. 4
      com.unity.perception/CHANGELOG.md

7
com.unity.perception/Tests/Runtime/Randomization/ScenarioTests/Resources/SampleScenarioConfiguration.json


"randomSeed": 539662031
},
"randomizers": {
"groups": {
"RotationRandomizer": {
"groups": [
{
"className": "RotationRandomizer",
"metadata": {
"name": "",
"description": "",

}
}
}
}
]
}
}

18
com.unity.perception/Runtime/Randomization/Scenarios/Serialization/ScenarioSerializer.cs


};
}
static Dictionary<string, Group> SerializeRandomizers(IEnumerable<Randomizer> randomizers)
static List<Group> SerializeRandomizers(IEnumerable<Randomizer> randomizers)
var serializedRandomizers = new Dictionary<string, Group>();
var serializedRandomizers = new List<Group>();
serializedRandomizers.Add(randomizer.GetType().Name, randomizerData);
serializedRandomizers.Add(randomizerData);
}
return serializedRandomizers;
}

var randomizerData = new Group();
var fields = randomizer.GetType().GetFields();
randomizerData.className = randomizer.GetType().Name;
foreach (var field in fields)
{
if (field.FieldType.IsSubclassOf(typeof(Randomization.Parameters.Parameter)))

DeserializeRandomizers(scenario.randomizers, template.groups);
}
static void DeserializeRandomizers(IEnumerable<Randomizer> randomizers, Dictionary<string, Group> groups)
static void DeserializeRandomizers(IEnumerable<Randomizer> randomizers, List<Group> groups)
foreach (var randomizerPair in groups)
foreach (var randomizerData in groups)
if (!randomizerTypeMap.ContainsKey(randomizerPair.Key))
if (!randomizerTypeMap.ContainsKey(randomizerData.className))
var randomizer = randomizerTypeMap[randomizerPair.Key];
DeserializeRandomizer(randomizer, randomizerPair.Value);
var randomizer = randomizerTypeMap[randomizerData.className];
DeserializeRandomizer(randomizer, randomizerData);
}
}

3
com.unity.perception/Runtime/Randomization/Scenarios/Serialization/SerializationStructures.cs


#region GroupedObjects
class TemplateConfigurationOptions
{
public Dictionary<string, Group> groups = new Dictionary<string, Group>();
public List<Group> groups = new List<Group>();
}
class StandardMetadata

class Group
{
public string className;
public StandardMetadata metadata = new StandardMetadata();
[JsonConverter(typeof(GroupItemsConverter))]
public Dictionary<string, IGroupItem> items = new Dictionary<string, IGroupItem>();

4
com.unity.perception/CHANGELOG.md


### Changed
Changed the JSON serialization key of Normal Sampler's standard deviation property from "standardDeviation" to "stddev". Scneario JSON configurations that were generated using previous versions will need to be manually updated to reflect this change.
Changed the JSON serialization key of Normal Sampler's standard deviation property from "standardDeviation" to "stddev".
Changed the JSON serialization of Randomizers in a scenario to an array of groups rather than a dictionary.
### Deprecated

正在加载...
取消
保存