Explorar o código

Fix model template not working with emitter

ShiroSmith %!s(int64=6) %!d(string=hai) anos
pai
achega
d2456d590e
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      hide/prefab/fx/Emitter.hx

+ 7 - 0
hide/prefab/fx/Emitter.hx

@@ -446,6 +446,13 @@ class EmitterObject extends h3d.scene.Object {
 
 		var template = particleTemplate.makeInstance(context);
 		var mesh = Std.instance(template.local3d, h3d.scene.Mesh);
+		if( mesh == null ) {
+			for( i in 0...template.local3d.numChildren ) {
+				mesh = Std.instance(template.local3d.getChildAt(i), h3d.scene.Mesh);
+				if( mesh != null ) break;
+			}
+		}
+
 		if( mesh != null && mesh.primitive != null ) {
 			var meshPrim = Std.instance(mesh.primitive, h3d.prim.MeshPrimitive);