public override void Init(ArkArchive archive, PropertyArray property) { int size = archive.ReadInt(); 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; } } for (int n = 0; n < size; n++) { Add(StructRegistry.ReadBinary(archive, structType)); } }
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))); }