public override void Init(JArray node, PropertyArray property) { int size = property.DataSize; ArkName structType = StructRegistry.MapArrayNameToTypeName(property.Name); if (structType == null) { if (size * 4 + 4 == property.DataSize) { structType = color; } else if (size * 12 + 4 == property.DataSize) { structType = vector; } else if (size * 16 + 4 == property.DataSize) { structType = linearColor; } } AddRange(node.Select(v => StructRegistry.ReadJson(v, structType))); }
public override void Init(JObject node) { base.Init(node); structType = ArkName.From(node.Value <string>("structType")); Value = node["unknown"] != null && node["unknown"].Type != JTokenType.Null ? new StructUnknown(node["unknown"]) : StructRegistry.ReadJson(node["value"], structType); }