public static ParseFieldValueAction GetParserMethodForType(FieldInstance instance) { ILDtkValueParser parser = ValueParsers.FirstOrDefault(p => p.TypeName(instance)); if (parser != null) { return(parser.ImportString); } Debug.LogError($"LDtk: C# type \"{instance.Type}\" is not a parseable LDtk field type."); return(null); }
public static ParseFieldValueAction GetParserMethodForType(FieldInstance instance) { ILDtkValueParser parser = ValueParsers.FirstOrDefault(p => p.TypeName(instance)); if (parser != null) { //never apply post processing to field values if it was a level. the builder would be null in this case if (_builder != null && parser is ILDtkPostParser postParser) { postParser.SupplyPostProcessorData(_builder, instance); } return(parser.ImportString); } Debug.LogError($"LDtk: C# type \"{instance.Type}\" is not a parseable LDtk field type."); return(null); }