future há 1 ano atrás
pai
commit
29ff78bae1

+ 1 - 1
assets/scene/game.scene

@@ -178,7 +178,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 960.0000000000001,
+    "_orthoHeight": 960,
     "_near": 0,
     "_far": 1000,
     "_color": {

+ 7 - 5
assets/script/run/sceneManager.ts

@@ -102,13 +102,15 @@ export class sceneManager extends Component {
         if(this.mPageList.length<=0){
             throw "不可以为空"
         }else{
-            this.stopMusic()
             this.mGameManager.loadScene(this.mPageList,data.type)
-            this.mGameManager.loadUi(gameManager.getUIWidgetList(data.page_list[this.mCurPage]))
-            this.mGameManager.loadQuestion(gameManager.getQuestionwidgetList(data.page_list[this.mCurPage]))
-            this.mGameManager.loadTextSound(gameManager.getTextSoundWidgetList(data.page_list[this.mCurPage]))
+            for (let index = 0; index < data.page_list.length; index++) {
+                const element = data.page_list[index];
+                this.mGameManager.loadUi(gameManager.getUIWidgetList(element))
+                this.mGameManager.loadQuestion(gameManager.getQuestionwidgetList(element))
+                this.mGameManager.loadTextSound(gameManager.getTextSoundWidgetList(element))
+                this.mGameManager.initCountDownList(gameManager.getCountDownWidgetList(element))
+            }
             this.mGameManager.initTaskUi(data._task_data)
-            this.mGameManager.initCountDownList(gameManager.getCountDownWidgetList(data.page_list[this.mCurPage]))
         }
     }
 }

+ 2 - 1
assets/script/run/scene_layer.ts

@@ -70,7 +70,8 @@ export class scene_layer extends Component {
     }
 
     addAudioItemAndPlay(res:string, volume:number,isLopp:boolean = false){
-        let content = this.getCurScenePage().node;
+        // let content = this.getCurScenePage().node;
+        let content = this.node;
         let audio_node = this.mAudioList.get(res)
         if(audio_node==null){
             audio_node = new Node

+ 2 - 2
assets/script/run/top_layer.ts

@@ -56,14 +56,14 @@ export class top_layer extends Component {
     }
 
     initQuestionList(list:widget_item_data[]){
-        this.mQuestionList.clear()
+        // this.mQuestionList.clear()
         for (let index = 0; index < list.length; index++) {
             const widget = list[index];
             this.mQuestionList.set(widget.att.id,widget);
         }
     }   
     initTextSoundLlist(list:widget_item_data[]){
-        this.mTextSoundList.clear()
+        // this.mTextSoundList.clear()
         for (let index = 0; index < list.length; index++) {
             const widget = list[index];
             this.mTextSoundList.set(widget.att.id,widget);

+ 1 - 1
assets/script/run/ui_layer.ts

@@ -72,7 +72,7 @@ export class ui_layer extends Component {
     }
 
     loadAllUi(){
-        this.ui_content.removeAllChildren()
+        // this.ui_content.removeAllChildren()
         for (let index = 0; index < this.mData.length; index++) {
             const ui_data = this.mData[index];
             let item: Node = null;

+ 7 - 1
assets/script/run/widget/widget_base.ts

@@ -30,13 +30,18 @@ export class widget_base extends Component {
         this.mData = data;
         this.icon.getComponent(UITransform).contentSize = new Size(this.mData.att.width,this.mData.att.height)
         this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
-        this.icon.angle = this.mData.att.rotation
+        if(this.mData.att.rotation == undefined || this.mData.att.rotation == null) {
+            this.icon.angle = 0
+        } else {
+            this.icon.angle = this.mData.att.rotation
+        }
         if(this.icon.getComponent(UIOpacity)===null){
             this.icon.addComponent(UIOpacity)
         }
         if(this.mData.att.src.length>0){
             this.icon.getComponent(Sprite).spriteFrame = gameManager.getCacheSpriteFrameByName(this.icon,this.mData.att.src)
         }
+        
         this.updateDir()
         this.mIsShow = this.mData.att.is_show;
         this.mIsActive = this.mData.att.is_interaction;
@@ -51,6 +56,7 @@ export class widget_base extends Component {
         // ClientEvent.on(config.EventRun.NOTICE_EVENT,this.beActive.bind(this),this)
         // ClientEvent.on(config.EventRun.WIDGET_HIDE,this.hide.bind(this),this)
     };
+
     updateDir(){
         switch (this.mData.att.img_dir) {
             case config.widget_scale_dir.left: