浏览代码

Fixed issue when the property is generating a warning

Temechon 7 年之前
父节点
当前提交
7c3143371c
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 2 2
      inspector/src/helpers/Helpers.ts
  2. 6 2
      inspector/src/tabs/SceneTab.ts

+ 2 - 2
inspector/src/helpers/Helpers.ts

@@ -202,12 +202,12 @@ module INSPECTOR {
          * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
          * @param obj 
          */
-        public static GetAllLinesPropertiesAsString(obj: any): Array<string> {
+        public static GetAllLinesPropertiesAsString(obj: any, dontTakeThis: Array<string>): Array<string> {
             let props: Array<string> = [];
 
             for (let prop in obj) {
                 //No private and no function
-                if (prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
+                if (dontTakeThis.indexOf(prop) === -1 && prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
                     props.push(prop);
                 }
             }

+ 6 - 2
inspector/src/tabs/SceneTab.ts

@@ -27,8 +27,12 @@ module INSPECTOR {
 
             // build propertiesline
             let details = [];
-            let props = Helpers.GetAllLinesProperties(this._inspector.scene);
-            for (let prop of props) {
+            // Remove deprecated properties generating warning in console
+            let dontTakeThis = ['interFramePerfCounter', 'lastFramePerfCounter', 'evaluateActiveMeshesDurationPerfCounter', 'renderDurationPerfCounter', 'particlesDurationPerfCounter', 'spriteDuractionPerfCounter'];
+            let props = Helpers.GetAllLinesPropertiesAsString(this._inspector.scene, dontTakeThis);
+
+            for (let propString of props) {
+                let prop = new PropertyLine(new Property(propString, this._inspector.scene));
                 details.push(prop);
             }
             this._detailsPanel.details = details;