Beispiel #1
0
        private NodeGUI(
            string name,
            string nodeId,
            AssetBundleGraphSettings.NodeKind kind,
            float x,
            float y,
            string scriptAttrNameOrClassName                         = null,
            Dictionary <string, string> loadPath                     = null,
            Dictionary <string, string> exportTo                     = null,
            List <string> filterContainsKeywords                     = null,
            List <string> filterContainsKeytypes                     = null,
            Dictionary <string, string> importerPackages             = null,
            Dictionary <string, string> groupingKeyword              = null,
            Dictionary <string, string> bundleNameTemplate           = null,
            Dictionary <string, string> variants                     = null,
            Dictionary <string, List <string> > enabledBundleOptions = null
            )
        {
            this.nodeInsp           = ScriptableObject.CreateInstance <NodeGUIInspectorHelper>();
            this.nodeInsp.hideFlags = HideFlags.DontSave;

            this.nodeWindowId = 0;
            this.name         = name;
            this.nodeId       = nodeId;
            this.kind         = kind;
            this.scriptAttrNameOrClassName = scriptAttrNameOrClassName;

            if (loadPath != null)
            {
                this.loadPath = new SerializablePseudoDictionary(loadPath);
            }
            if (exportTo != null)
            {
                this.exportTo = new SerializablePseudoDictionary(exportTo);
            }
            this.filterContainsKeywords = filterContainsKeywords;
            this.filterContainsKeytypes = filterContainsKeytypes;
            if (importerPackages != null)
            {
                this.importerPackages = new SerializablePseudoDictionary(importerPackages);
            }
            if (groupingKeyword != null)
            {
                this.groupingKeyword = new SerializablePseudoDictionary(groupingKeyword);
            }
            if (bundleNameTemplate != null)
            {
                this.bundleNameTemplate = new SerializablePseudoDictionary(bundleNameTemplate);
            }
            if (variants != null)
            {
                this.variants = new SerializablePseudoDictionary(variants);
            }
            if (enabledBundleOptions != null)
            {
                this.enabledBundleOptions = new SerializablePseudoDictionary2(enabledBundleOptions);
            }

            this.baseRect = new Rect(x, y, AssetBundleGraphGUISettings.NODE_BASE_WIDTH, AssetBundleGraphGUISettings.NODE_BASE_HEIGHT);

            switch (this.kind)
            {
            case AssetBundleGraphSettings.NodeKind.LOADER_GUI:
            case AssetBundleGraphSettings.NodeKind.EXPORTER_GUI: {
                this.nodeInterfaceTypeStr = "flow node 0";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.FILTER_GUI: {
                this.nodeInterfaceTypeStr = "flow node 1";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.IMPORTSETTING_GUI: {
                this.nodeInterfaceTypeStr = "flow node 2";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
                this.nodeInterfaceTypeStr = "flow node 6";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: {
                this.nodeInterfaceTypeStr = "flow node 3";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_GUI:
            {
                this.nodeInterfaceTypeStr = "flow node 4";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.BUNDLIZER_GUI: {
                this.nodeInterfaceTypeStr = "flow node 5";
                break;
            }

            case AssetBundleGraphSettings.NodeKind.BUNDLEBUILDER_GUI: {
                this.nodeInterfaceTypeStr = "flow node 6";
                break;
            }

            default: {
                Debug.LogError(this.name + " is defined as unknown kind of node. value:" + this.kind);
                break;
            }
            }
        }
Beispiel #2
0
        private Node(
            int index,
            string name,
            string nodeId,
            AssetBundleGraphSettings.NodeKind kind,
            float x,
            float y,
            string scriptType = null,
            string scriptPath = null,
            Dictionary<string, string> loadPath = null,
            Dictionary<string, string> exportPath = null,
            List<string> filterContainsKeywords = null,
            List<string> filterContainsKeytypes = null,
            Dictionary<string, string> importerPackages = null,
            Dictionary<string, string> modifierPackages = null,
            Dictionary<string, string> groupingKeyword = null,
            Dictionary<string, string> bundleNameTemplate = null,
            Dictionary<string, string> bundleUseOutput = null,
            Dictionary<string, List<string>> enabledBundleOptions = null
            )
        {
            nodeInsp = ScriptableObject.CreateInstance<NodeInspector>();
            nodeInsp.hideFlags = HideFlags.DontSave;
            this.nodeWindowId = index;
            this.name = name;
            this.nodeId = nodeId;
            this.kind = kind;
            this.scriptType = scriptType;
            this.scriptPath = scriptPath;
            if (loadPath != null) this.loadPath = new SerializablePseudoDictionary(loadPath);
            if (exportPath != null) this.exportPath = new SerializablePseudoDictionary(exportPath);
            this.filterContainsKeywords = filterContainsKeywords;
            this.filterContainsKeytypes = filterContainsKeytypes;
            if (importerPackages != null) this.importerPackages = new SerializablePseudoDictionary(importerPackages);
            if (modifierPackages != null) this.modifierPackages = new SerializablePseudoDictionary(modifierPackages);
            if (groupingKeyword != null) this.groupingKeyword = new SerializablePseudoDictionary(groupingKeyword);
            if (bundleNameTemplate != null) this.bundleNameTemplate = new SerializablePseudoDictionary(bundleNameTemplate);
            if (bundleUseOutput != null) this.bundleUseOutput = new SerializablePseudoDictionary(bundleUseOutput);
            if (enabledBundleOptions != null) this.enabledBundleOptions = new SerializablePseudoDictionary2(enabledBundleOptions);

            this.baseRect = new Rect(x, y, AssetBundleGraphGUISettings.NODE_BASE_WIDTH, AssetBundleGraphGUISettings.NODE_BASE_HEIGHT);

            switch (this.kind) {
                case AssetBundleGraphSettings.NodeKind.LOADER_GUI:
                case AssetBundleGraphSettings.NodeKind.EXPORTER_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 0";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.FILTER_SCRIPT:
                case AssetBundleGraphSettings.NodeKind.FILTER_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 1";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.IMPORTSETTING_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 2";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 4";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 3";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_SCRIPT:
                case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_GUI:
                 {
                    this.nodeInterfaceTypeStr = "flow node 4";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.BUNDLIZER_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 5";
                    break;
                }

                case AssetBundleGraphSettings.NodeKind.BUNDLEBUILDER_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 6";
                    break;
                }

                default: {
                    Debug.LogError("failed to match:" + this.kind);
                    break;
                }
            }
        }