فهرست منبع

Inspector : audio tab renamed and pause button fixed

Julian 8 سال پیش
والد
کامیت
bb1d067205

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 3
dist/preview release/inspector/babylon.inspector.bundle.js


+ 6 - 1
dist/preview release/inspector/babylon.inspector.js

@@ -778,7 +778,12 @@ var INSPECTOR;
             return tools;
         };
         SoundAdapter.prototype.setPlaying = function (callback) {
-            this._obj.play();
+            if (this._obj.isPlaying) {
+                this._obj.pause();
+            }
+            else {
+                this._obj.play();
+            }
             this._obj.onended = function () {
                 callback();
             };

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/inspector/babylon.inspector.min.js


+ 0 - 1
inspector/src/Inspector.ts

@@ -160,7 +160,6 @@ module INSPECTOR {
                 else {
                     inspector = Helpers.CreateDiv('insp-right-panel', this._c2diwrapper);
                 }
-                console.log(inspector);
 
                 // Add split bar
                 if (!this._parentElement) {

+ 7 - 2
inspector/src/adapters/SoundAdapter.ts

@@ -44,8 +44,13 @@ module INSPECTOR {
             return tools;
         }
 
-        public setPlaying(callback:Function) {
-            (this._obj as BABYLON.Sound).play();
+        public setPlaying(callback: Function) {
+            if ((this._obj as BABYLON.Sound).isPlaying) {
+                (this._obj as BABYLON.Sound).pause();
+            }
+            else {
+                (this._obj as BABYLON.Sound).play();
+            }
             (this._obj as BABYLON.Sound).onended = () => {
                 callback();
             }

+ 10 - 10
inspector/src/tabs/SoundTab.ts

@@ -1,14 +1,14 @@
-module INSPECTOR{
-    
+module INSPECTOR {
+
     export class SoundTab extends PropertyTab {
-                
-        constructor(tabbar:TabBar, inspector:Inspector) {
-            super(tabbar, 'Sound', inspector); 
+
+        constructor(tabbar: TabBar, inspector: Inspector) {
+            super(tabbar, 'Audio', inspector);
         }
-    /* Overrides super */
-        protected _getTree() : Array<TreeItem> {
+        /* Overrides super */
+        protected _getTree(): Array<TreeItem> {
             let arr = [];
-                        
+
             // get all cameras from the first scene
             let instances = this._inspector.scene;
             for (let sounds of instances.soundTracks) {
@@ -16,11 +16,11 @@ module INSPECTOR{
                 sound.forEach(element => {
                     arr.push(new TreeItem(this, new SoundAdapter(element)));
                 });
-                
+
             }
             return arr;
         }
 
     }
-    
+
 }