public static INodeOperation CreateOperation(SaveData saveData, NodeData currentNodeData, Action<NodeException> errorHandler)
{
INodeOperation executor = null;
try {
switch (currentNodeData.Kind) {
case NodeKind.LOADER_GUI: {
executor = new IntegratedGUILoader();
break;
}
case NodeKind.FILTER_GUI: {
// Filter requires multiple output connections
var connectionsToChild = saveData.Connections.FindAll(c => c.FromNodeId == currentNodeData.Id);
executor = new IntegratedGUIFilter(connectionsToChild);
break;
}
case NodeKind.IMPORTSETTING_GUI: {
executor = new IntegratedGUIImportSetting();
break;
}
case NodeKind.MODIFIER_GUI: {
executor = new IntegratedGUIModifier();
break;
}
case NodeKind.GROUPING_GUI: {
executor = new IntegratedGUIGrouping();
break;
}
case NodeKind.PREFABBUILDER_GUI: {
executor = new IntegratedPrefabBuilder();
break;
}
case NodeKind.BUNDLECONFIG_GUI: {
executor = new IntegratedGUIBundleConfigurator();
break;
}
case NodeKind.BUNDLEBUILDER_GUI: {
executor = new IntegratedGUIBundleBuilder();
break;
}
case NodeKind.EXPORTER_GUI: {
executor = new IntegratedGUIExporter();
break;
}
default: {
Debug.LogError(currentNodeData.Name + " is defined as unknown kind of node. value:" + currentNodeData.Kind);
break;
}
}
} catch (NodeException e) {
errorHandler(e);
}
return executor;
}