public void Setup(BuildTarget target, NodeData node, IEnumerable <PerformGraph.AssetGroups> incoming, IEnumerable <ConnectionData> connectionsToOutput, PerformGraph.Output Output) { Action <Type, Type, AssetReference> multipleAssetTypeFound = (Type expectedType, Type foundType, AssetReference foundAsset) => { throw new NodeException(string.Format("{3} :ImportSetting expect {0}, but different type of incoming asset is found({1} {2})", expectedType.FullName, foundType.FullName, foundAsset.fileNameAndExtension, node.Name), node.Id); }; Action <Type> unsupportedType = (Type unsupported) => { throw new NodeException(string.Format("{0} :Incoming asset type is not supported by ImportSetting (Incoming type:{1}). Perhaps you want to use Modifier instead?", node.Name, (unsupported != null)?unsupported.FullName:"null"), node.Id); }; Action <Type, Type> incomingTypeMismatch = (Type expectedType, Type incomingType) => { throw new NodeException(string.Format("{0} :Incoming asset type is does not match with this ImportSetting (Expected type:{1}, Incoming type:{2}).", node.Name, (expectedType != null)?expectedType.FullName:"null", (incomingType != null)?incomingType.FullName:"null"), node.Id); }; Action <ConfigStatus> errorInConfig = (ConfigStatus _) => { var firstAsset = TypeUtility.GetFirstIncomingAsset(incoming); if (firstAsset != null) { // give a try first in sampling file SaveSampleFile(node, firstAsset); ValidateInputSetting(node, target, incoming, multipleAssetTypeFound, unsupportedType, incomingTypeMismatch, (ConfigStatus eType) => { if (eType == ConfigStatus.NoSampleFound) { throw new NodeException(node.Name + " :ImportSetting has no sampling file. Please configure it from Inspector.", node.Id); } if (eType == ConfigStatus.TooManySamplesFound) { throw new NodeException(node.Name + " :ImportSetting has too many sampling file. Please fix it from Inspector.", node.Id); } }); } }; ValidateInputSetting(node, target, incoming, multipleAssetTypeFound, unsupportedType, incomingTypeMismatch, errorInConfig); // ImportSettings does not add, filter or change structure of group, so just pass given group of assets if (incoming != null && Output != null) { var dst = (connectionsToOutput == null || !connectionsToOutput.Any())? null : connectionsToOutput.First(); foreach (var ag in incoming) { Output(dst, ag.assetGroups); } } }