瀏覽代碼

Split Spawn and Simulation gpu emitter shaders in context menu.

clementlandrin 8 月之前
父節點
當前提交
ecbb75da3f
共有 2 個文件被更改,包括 15 次插入6 次删除
  1. 6 1
      bin/defaultProps.json
  2. 9 5
      hide/view/FXEditor.hx

+ 6 - 1
bin/defaultProps.json

@@ -148,7 +148,12 @@
 	"sceneeditor.scalePrecision": 0.01,
 	"sceneeditor.rotatePrecision": 0.1,
 
-	"sceneeditor.newgroups" : ["2D|hrt.prefab.Object2D","3D|hrt.prefab.Object3D","RFX|hrt.prefab.rfx.RendererFX"],
+	"sceneeditor.newgroups" : ["2D|hrt.prefab.Object2D",
+		"3D|hrt.prefab.Object3D",
+		"RFX|hrt.prefab.rfx.RendererFX",
+		"Spawn|hrt.prefab.fx.gpuemitter.SpawnShader",
+		"Simulation|hrt.prefab.fx.gpuemitter.SimulationShader"
+	],
 	"sceneeditor.recentsize" : 6,
 
 	"sceneeditor.icons" : {},

+ 9 - 5
hide/view/FXEditor.hx

@@ -212,13 +212,13 @@ private class FXSceneEditor extends hide.comp.SceneEditor {
 			return ret;
 		}
 		var allTypes = super.getNewContextMenu(current, onMake, false);
+		var allTypesGrouped = super.getNewContextMenu(current, onMake, true);
 		var recents = getNewRecentContextMenu(current, onMake);
 
 		var menu = [];
-
-
-
 		var shaderItems : Array<hide.comp.ContextMenu.MenuItem> = [];
+		var spawnItems : Array<hide.comp.ContextMenu.MenuItem> = [];
+		var simulationItems : Array<hide.comp.ContextMenu.MenuItem> = [];
 
 		if (parent.is2D) {
 			for(name in ["Group 2D", "Bitmap", "Anim2D", "Atlas", "Particle2D", "Text", "Shader", "Shader Graph", "Placeholder"]) {
@@ -285,13 +285,17 @@ private class FXSceneEditor extends hide.comp.SceneEditor {
 
 		menu.push({label: null, isSeparator: true});
 
-		//splitMenu(menu, "Shader", shaderItems);
 		menu.push({label: "Shader", menu: shaderItems});
 
+		var spawn = allTypesGrouped.find(t -> t.label == "Spawn");
+		if ( spawn != null )
+			menu.push({label: "Spawn", menu: spawn.menu});
+		var simulation = allTypesGrouped.find(t-> t.label == "Simulation");
+		if ( simulation != null )
+			menu.push({label: "Simulation", menu: simulation.menu});
 
 		menu.push({label: null, isSeparator: true});
 
-		//splitMenu(menu, "Other", allTypes);
 		menu.push({label: "Other", menu: allTypes});
 
 		menu.unshift({