future 1 年之前
父節點
當前提交
696a25d973
共有 1 個文件被更改,包括 9 次插入0 次删除
  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)