示例#1
0
		public static Node ExporterNode (int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, Dictionary<string, string> exportPath, float x, float y) {
			return new Node(
				index: index,
				name: name,
				nodeId: nodeId,
				kind: kind,
				x: x,
				y: y,
				exportPath: exportPath
			);
		}
示例#2
0
        private Node(
			int index, 
			string name, 
			string nodeId, 
			AssetGraphSettings.NodeKind kind, 
			float x, 
			float y,
			string scriptType = null, 
			string scriptPath = null, 
			string loadPath = null, 
			string exportPath = null, 
			List<string> filterContainsKeywords = null, 
			string groupingKeyword = null,
			string bundleNameTemplate = null,
			Dictionary<string, bool> bundleOptions = 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;
            this.loadPath = loadPath;
            this.exportPath = exportPath;
            this.filterContainsKeywords = filterContainsKeywords;
            this.groupingKeyword = groupingKeyword;
            this.bundleNameTemplate = bundleNameTemplate;
            this.bundleOptions = bundleOptions;

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

            switch (this.kind) {
                case AssetGraphSettings.NodeKind.LOADER_SCRIPT:
                case AssetGraphSettings.NodeKind.LOADER_GUI:

                case AssetGraphSettings.NodeKind.EXPORTER_GUI:
                case AssetGraphSettings.NodeKind.EXPORTER_SCRIPT: {
                    this.nodeInterfaceTypeStr = "flow node 0";
                    break;
                }

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

                case AssetGraphSettings.NodeKind.IMPORTER_SCRIPT:
                case AssetGraphSettings.NodeKind.IMPORTER_GUI: {
                    this.nodeInterfaceTypeStr = "flow node 2";
                    break;
                }

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

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

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

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

                default: {
                    Debug.LogError("failed to match:" + this.kind);
                    break;
                }
            }
        }
示例#3
0
 public static Node ScriptNode(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, string scriptType, string scriptPath, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y,
         scriptType: scriptType,
         scriptPath: scriptPath
     );
 }
示例#4
0
 public static Node LoaderNode(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, string loadPath, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y,
         loadPath: loadPath
     );
 }
示例#5
0
 public static Node GUINodeForPrefabricator(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y
     );
 }
示例#6
0
 public static Node GUINodeForGrouping(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, string groupingKeyword, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y,
         groupingKeyword: groupingKeyword
     );
 }
示例#7
0
 public static Node GUINodeForFilter(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, List<string> filterContainsKeywords, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y,
         filterContainsKeywords: filterContainsKeywords
     );
 }
示例#8
0
 public static Node GUINodeForBundlizer(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, string bundleNameTemplate, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y,
         bundleNameTemplate: bundleNameTemplate
     );
 }
示例#9
0
 public static Node GUINodeForBundleBuilder(int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, Dictionary<string, bool> bundleOptions, float x, float y)
 {
     return new Node(
         index: index,
         name: name,
         nodeId: nodeId,
         kind: kind,
         x: x,
         y: y,
         bundleOptions: bundleOptions
     );
 }
示例#10
0
        private void AddNodeFromGUI(string nodeName, AssetGraphSettings.NodeKind kind, string nodeId, float x, float y)
        {
            Node newNode = null;

            if (string.IsNullOrEmpty(nodeName)) nodeName = AssetGraphSettings.DEFAULT_NODE_NAME[kind];

            switch (kind) {
                case AssetGraphSettings.NodeKind.LOADER_GUI: {
                    newNode = Node.LoaderNode(nodes.Count, nodeName, nodeId, kind, RelativeProjectPath(), x, y);
                    newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.FILTER_GUI: {
                    newNode = Node.GUINodeForFilter(nodes.Count, nodeName, nodeId, kind, new List<string>(), x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.IMPORTER_GUI: {
                    newNode = Node.GUINodeForImport(nodes.Count, nodeName, nodeId, kind, x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.GROUPING_GUI: {
                    newNode = Node.GUINodeForGrouping(nodes.Count, nodeName, nodeId, kind, string.Empty, x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.PREFABRICATOR_GUI:{
                    newNode = Node.GUINodeForPrefabricator(nodes.Count, nodeName, nodeId, kind, x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.BUNDLIZER_GUI: {
                    newNode = Node.GUINodeForBundlizer(nodes.Count, nodeName, nodeId, kind, string.Empty, x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.BUNDLEBUILDER_GUI: {
                    var bundleOptions = AssetGraphSettings.DefaultBundleOptionSettings;
                    newNode = Node.GUINodeForBundleBuilder(nodes.Count, nodeName, nodeId, kind, bundleOptions, x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
                    break;
                }

                case AssetGraphSettings.NodeKind.EXPORTER_GUI: {
                    newNode = Node.ExporterNode(nodes.Count, nodeName, nodeId, kind, RelativeProjectPath(), x, y);
                    newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
                    break;
                }
                default: {
                    Debug.LogError("no kind match:" + kind);
                    break;
                }
            }

            if (newNode == null) return;
            Undo.RecordObject(this, "Add Node");

            nodes.Add(newNode);
        }
示例#11
0
 public ActiveObject(AssetGraphSettings.ObjectKind kind, string id, Vector2 pos)
 {
     this.kind = kind;
     this.id = id;
     this.pos = pos;
 }
示例#12
0
		private void AddNodeFromGUI (string nodeName, AssetGraphSettings.NodeKind kind, string nodeId, float x, float y) {
			Node newNode = null;

			if (string.IsNullOrEmpty(nodeName)) nodeName = AssetGraphSettings.DEFAULT_NODE_NAME[kind] + nodes.Where(node => node.kind == kind).ToList().Count;
			
			switch (kind) {
				case AssetGraphSettings.NodeKind.LOADER_GUI: {
					var default_platform_package_loadPath = new Dictionary<string, string> {
						{AssetGraphSettings.PLATFORM_DEFAULT_NAME, string.Empty}
					};

					newNode = Node.LoaderNode(nodes.Count, nodeName, nodeId, kind, default_platform_package_loadPath, x, y);
					newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
					break;
				}

				case AssetGraphSettings.NodeKind.FILTER_GUI: {
					var newFilterKeywords = new List<string>();
					newNode = Node.GUINodeForFilter(nodes.Count, nodeName, nodeId, kind, newFilterKeywords, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					break;
				}
				
				case AssetGraphSettings.NodeKind.IMPORTER_GUI: {
					var importerPackages = new Dictionary<string, string> {
						{AssetGraphSettings.PLATFORM_DEFAULT_NAME, string.Empty}
					};

					newNode = Node.GUINodeForImport(nodes.Count, nodeName, nodeId, kind, importerPackages, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
					break;
				}

				case AssetGraphSettings.NodeKind.GROUPING_GUI: {
					var newGroupingKeywords = new Dictionary<string, string> {
						{AssetGraphSettings.PLATFORM_DEFAULT_NAME, AssetGraphSettings.GROUPING_KEYWORD_DEFAULT}
					};

					newNode = Node.GUINodeForGrouping(nodes.Count, nodeName, nodeId, kind, newGroupingKeywords, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
					break;
				}
				
				case AssetGraphSettings.NodeKind.PREFABRICATOR_GUI:{
					newNode = Node.GUINodeForPrefabricator(nodes.Count, nodeName, nodeId, kind, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
					break;
				}

				case AssetGraphSettings.NodeKind.BUNDLIZER_GUI: {
					var newBundlizerKeyword = new Dictionary<string, string> {
						{AssetGraphSettings.PLATFORM_DEFAULT_NAME, AssetGraphSettings.BUNDLIZER_BUNDLENAME_TEMPLATE_DEFAULT}
					};

					newNode = Node.GUINodeForBundlizer(nodes.Count, nodeName, nodeId, kind, newBundlizerKeyword, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
					break;
				}

				case AssetGraphSettings.NodeKind.BUNDLEBUILDER_GUI: {
					var bundleOptions = new Dictionary<string, List<string>>{
						{AssetGraphSettings.PLATFORM_DEFAULT_NAME, new List<string>()}
					};

					newNode = Node.GUINodeForBundleBuilder(nodes.Count, nodeName, nodeId, kind, bundleOptions, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					newNode.AddConnectionPoint(new OutputPoint(AssetGraphSettings.DEFAULT_OUTPUTPOINT_LABEL));
					break;
				}

				case AssetGraphSettings.NodeKind.EXPORTER_GUI: {
					var default_platform_package_exportPath = new Dictionary<string, string> {
						{AssetGraphSettings.PLATFORM_DEFAULT_NAME, string.Empty}
					};

					newNode = Node.ExporterNode(nodes.Count, nodeName, nodeId, kind, default_platform_package_exportPath, x, y);
					newNode.AddConnectionPoint(new InputPoint(AssetGraphSettings.DEFAULT_INPUTPOINT_LABEL));
					break;
				}
				default: {
					Debug.LogError("no kind match:" + kind);
					break;
				}
			}

			if (newNode == null) return;
			Undo.RecordObject(this, "Add Node");

			nodes.Add(newNode);
		}
示例#13
0
		private Node (
			int index, 
			string name, 
			string nodeId, 
			AssetGraphSettings.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, 
			Dictionary<string, string> importerPackages = null,
			Dictionary<string, string> groupingKeyword = null,
			Dictionary<string, string> bundleNameTemplate = 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;
			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 (enabledBundleOptions != null) this.enabledBundleOptions = new SerializablePseudoDictionary2(enabledBundleOptions);
			
			this.baseRect = new Rect(x, y, AssetGraphGUISettings.NODE_BASE_WIDTH, AssetGraphGUISettings.NODE_BASE_HEIGHT);
			
			switch (this.kind) {
				case AssetGraphSettings.NodeKind.LOADER_GUI:
				case AssetGraphSettings.NodeKind.EXPORTER_GUI: {
					this.nodeInterfaceTypeStr = "flow node 0";
					break;
				}

				case AssetGraphSettings.NodeKind.FILTER_SCRIPT:
				case AssetGraphSettings.NodeKind.FILTER_GUI: {
					this.nodeInterfaceTypeStr = "flow node 1";
					break;
				}
				
				case AssetGraphSettings.NodeKind.IMPORTER_SCRIPT:
				case AssetGraphSettings.NodeKind.IMPORTER_GUI: {
					this.nodeInterfaceTypeStr = "flow node 2";
					break;
				}

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

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

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

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

				default: {
					Debug.LogError("failed to match:" + this.kind);
					break;
				}
			}
		}
示例#14
0
		public static Node GUINodeForImport (int index, string name, string nodeId, AssetGraphSettings.NodeKind kind, Dictionary<string, string> importerPackages, float x, float y) {
			return new Node(
				index: index,
				name: name,
				nodeId: nodeId,
				kind: kind,
				x: x,
				y: y,
				importerPackages: importerPackages
			);
		}