Browse Source

Scene: autoHide meshes which name starts by patterns

trethaller 6 years ago
parent
commit
efa4464a35
1 changed files with 3 additions and 2 deletions
  1. 3 2
      hide/comp/Scene.hx

+ 3 - 2
hide/comp/Scene.hx

@@ -141,8 +141,9 @@ class Scene extends Component implements h3d.IDrawable {
 	public function init( ?root : h3d.scene.Object ) {
 	public function init( ?root : h3d.scene.Object ) {
 		var autoHide : Array<String> = config.get("scene.autoHide");
 		var autoHide : Array<String> = config.get("scene.autoHide");
 		function initRec( obj : h3d.scene.Object ) {
 		function initRec( obj : h3d.scene.Object ) {
-			if( autoHide.indexOf(obj.name) >= 0 )
-				obj.visible = false;
+			for(n in autoHide)
+				if(obj.name != null && obj.name.indexOf(n) == 0)
+					obj.visible = false;
 			for( o in obj )
 			for( o in obj )
 				initRec(o);
 				initRec(o);
 		}
 		}