future 1 anno fa
parent
commit
696a25d973
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      assets/script/run/sceneManager.ts

+ 9 - 0
assets/script/run/sceneManager.ts

@@ -63,6 +63,15 @@ export class sceneManager extends Component {
         this.getSound().pause()
     }
 
+    public play_music(){
+        if(this.getSound().clip!=null){
+            this.playClip(this.getSound().clip); 
+        }else{
+            gameManager.Singleton.getSceneManager().playMusic(gameManager.getSysData().content.sys_piped_music,true)
+        }
+    
+    }
+
     getSound(){
         if(this.node.getComponent(AudioSource)!=null){
             return this.node.getComponent(AudioSource)