浏览代码

Merge pull request #3302 from RaananW/custom-build-stuff

Custom build dependencies
sebavan 7 年之前
父节点
当前提交
8eaf7dff52
共有 4 个文件被更改,包括 16 次插入13 次删除
  1. 2 1
      Tools/Gulp/config.json
  2. 11 9
      src/Materials/babylon.multiMaterial.ts
  3. 1 1
      src/Mesh/babylon.mesh.ts
  4. 2 2
      src/babylon.scene.ts

+ 2 - 1
Tools/Gulp/config.json

@@ -931,7 +931,8 @@
                 "../../src/Physics/Plugins/babylon.oimoJSPlugin.js"
             ],
             "dependUpon": [
-                "core"
+                "core",
+                "picking"
             ]
         },
         "textureFormats": {

+ 11 - 9
src/Materials/babylon.multiMaterial.ts

@@ -9,10 +9,10 @@
             this._subMaterials = value;
             this._hookArray(value);
         }
-        
+
         constructor(name: string, scene: Scene) {
             super(name, scene, true);
-            
+
             scene.multiMaterials.push(this);
 
             this.subMaterials = new Array<Material>();
@@ -38,7 +38,7 @@
 
                 return deleted;
             }
-        }    
+        }
 
         // Properties
         public getSubMaterial(index: number): Nullable<Material> {
@@ -52,10 +52,11 @@
         public getActiveTextures(): BaseTexture[] {
             return super.getActiveTextures().concat(...this.subMaterials.map(subMaterial => {
                 if (subMaterial) {
-                return subMaterial.getActiveTextures();
-            } else {
-                return [];
-            }}));
+                    return subMaterial.getActiveTextures();
+                } else {
+                    return [];
+                }
+            }));
         }
 
         // Methods
@@ -105,8 +106,9 @@
 
             serializationObject.name = this.name;
             serializationObject.id = this.id;
-            serializationObject.tags = Tags.GetTags(this);
-
+            if (Tags) {
+                serializationObject.tags = Tags.GetTags(this);
+            }
             serializationObject.materials = [];
 
             for (var matIndex = 0; matIndex < this.subMaterials.length; matIndex++) {

+ 1 - 1
src/Mesh/babylon.mesh.ts

@@ -178,7 +178,7 @@
                 Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source"], ["_poseMatrix", "_source"]);
 
                 // Tags
-                if (Tags.HasTags(source)) {
+                if (Tags && Tags.HasTags(source)) {
                     Tags.AddTagsTo(this, Tags.GetTags(source, true));
                 }
 

+ 2 - 2
src/babylon.scene.ts

@@ -3377,7 +3377,7 @@
                 let defaultFrameTime = 1000 / 60; // frame time in MS
 
                 if (this._physicsEngine) {
-                    defaultFrameTime = this._physicsEngine.getTimeStep() / 1000; //timestep in physics engine is in seconds
+                    defaultFrameTime = this._physicsEngine.getTimeStep() / 1000;
                 }
                 let stepsTaken = 0;
 
@@ -4492,7 +4492,7 @@
 
             for (var i in list) {
                 var item = list[i];
-                if (Tags.MatchesQuery(item, tagsQuery)) {
+                if (Tags && Tags.MatchesQuery(item, tagsQuery)) {
                     listByTags.push(item);
                     forEach(item);
                 }