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;
        }
        private void DoInspectorBundleConfiguratorGUI(NodeGUI node)
        {
            if (node.Data.BundleNameTemplate == null)
            {
                return;
            }

            EditorGUILayout.HelpBox("BundleConfigurator: Create asset bundle settings with given group of assets.", MessageType.Info);
            UpdateNodeName(node);

            GUILayout.Space(10f);

            //Show target configuration tab
            DrawPlatformSelector(node);
            using (new EditorGUILayout.VerticalScope(GUI.skin.box)) {
                var disabledScope = DrawOverrideTargetToggle(node, node.Data.BundleNameTemplate.ContainsValueOf(currentEditingGroup), (bool enabled) => {
                    using (new RecordUndoScope("Remove Target Bundle Name Template Setting", node, true)){
                        if (enabled)
                        {
                            node.Data.BundleNameTemplate[currentEditingGroup] = node.Data.BundleNameTemplate.DefaultValue;
                        }
                        else
                        {
                            node.Data.BundleNameTemplate.Remove(currentEditingGroup);
                        }
                    }
                });

                using (disabledScope) {
                    var bundleNameTemplate = EditorGUILayout.TextField("Bundle Name Template", node.Data.BundleNameTemplate[currentEditingGroup]).ToLower();

                    if (bundleNameTemplate != node.Data.BundleNameTemplate[currentEditingGroup])
                    {
                        using (new RecordUndoScope("Change Bundle Name Template", node, true)){
                            node.Data.BundleNameTemplate[currentEditingGroup] = bundleNameTemplate;
                        }
                    }
                }
            }

            using (new EditorGUILayout.VerticalScope(GUI.skin.box)) {
                GUILayout.Label("Variants:");
                var     variantNames = node.Data.Variants.Select(v => v.Name).ToList();
                Variant removing     = null;
                foreach (var v in node.Data.Variants)
                {
                    using (new GUILayout.HorizontalScope()) {
                        if (GUILayout.Button("-", GUILayout.Width(30)))
                        {
                            removing = v;
                        }
                        else
                        {
                            GUIStyle s             = new GUIStyle((GUIStyle)"TextFieldDropDownText");
                            Action   makeStyleBold = () => {
                                s.fontStyle = FontStyle.Bold;
                                s.fontSize  = 12;
                            };

                            IntegratedGUIBundleConfigurator.ValidateVariantName(v.Name, variantNames,
                                                                                makeStyleBold,
                                                                                makeStyleBold,
                                                                                makeStyleBold);

                            var variantName = EditorGUILayout.TextField(v.Name, s);

                            if (variantName != v.Name)
                            {
                                using (new RecordUndoScope("Change Variant Name", node, true)){
                                    v.Name = variantName;
                                }
                            }
                        }
                    }
                }
                if (GUILayout.Button("+"))
                {
                    using (new RecordUndoScope("Add Variant", node, true)){
                        node.Data.AddVariant(AssetBundleGraphSettings.BUNDLECONFIG_VARIANTNAME_DEFAULT);
                    }
                }
                if (removing != null)
                {
                    using (new RecordUndoScope("Remove Variant", node, true)){
                        // event must raise to remove connection associated with point
                        NodeGUIUtility.NodeEventHandler(new NodeEvent(NodeEvent.EventType.EVENT_CONNECTIONPOINT_DELETED, node, Vector2.zero, removing.ConnectionPoint));
                        node.Data.RemoveVariant(removing);
                    }
                }
            }
        }
        private INodeOperation CreateOperation(NodeData currentNodeData)
        {
            INodeOperation executor = null;

            try {
                switch (currentNodeData.Kind)
                {
                case NodeKind.LOADER_GUI: {
                    executor = new IntegratedGUILoader();
                    break;
                }

                case NodeKind.FILTER_GUI: {
                    executor = new IntegratedGUIFilter();
                    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: {
                    LogUtility.Logger.LogError(LogUtility.kTag, currentNodeData.Name + " is defined as unknown kind of node. value:" + currentNodeData.Kind);
                    break;
                }
                }
            } catch (NodeException e) {
                m_nodeExceptions.Add(e);
            }

            return(executor);
        }
예제 #4
0
        public static INodeOperation CreateOperation(SaveData saveData, NodeData currentNodeData)
        {
            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) {
                AssetBundleGraphEditorWindow.AddNodeException(e);
                //Debug.LogError("error occured:\"" + e.reason + "\", please check information on node.");
                //throw new AssetBundleGraphException(node.Name + ": " + e.reason);
            }

            return(executor);
        }
        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);
        }