future 1 سال پیش
والد
کامیت
ba877c114a

+ 1 - 1
assets/edit_game.scene

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

+ 2 - 0
assets/script/config.ts

@@ -310,6 +310,8 @@ export class config {
         ON_WIN:"ON_WIN",  //胜利
         SHOW_TIPS:"SHOW_TIPS",  //显示一个提示
         TOGGLE_YIN_YUE:"TOGGLE_YIN_YUE",  //开关音乐
+        MORE_SCENE_DIRECTION_CLICK_FINISH:"MORE_SCENE_DIRECTION_CLICK_FINISH", //多场景方向点击完成
+
     }
     static MSG_CODE = {
         SUCCESS: 10000,

+ 8 - 6
assets/script/edit/scroll_scene.ts

@@ -153,12 +153,14 @@ export class scroll_scene extends Component {
     }
 
     public getScenePageAtt(){
-        this.m_att.name = this.m_data.name!=""?this.m_data.name:"场景";
-        this.m_att.height = this.getBg().getComponent(UITransform).contentSize.height;
-        this.m_att.width = this.getBg().getComponent(UITransform).contentSize.width;
-        this.m_att.rotation = this.getBg().angle;
-        this.m_att.type = config.attributes_type.scene;
-        this.m_att.src_name = this.m_att.src.length>0? this.m_att.src_name:"空";
+        if(this.m_att.height===0||this.m_att.width===0){ 
+            this.m_att.name = this.m_data.name!=""?this.m_data.name:"场景";
+            this.m_att.height = this.getBg().getComponent(UITransform).contentSize.height;
+            this.m_att.width = this.getBg().getComponent(UITransform).contentSize.width;
+            this.m_att.rotation = this.getBg().angle;
+            this.m_att.type = config.attributes_type.scene;
+            this.m_att.src_name = this.m_att.src.length>0? this.m_att.src_name:"空";
+        }
         return this.m_att;
     }
 

+ 4 - 0
assets/script/run/TaskSchedule/taskServce.ts

@@ -229,6 +229,10 @@ export class taskServce {
             case config.event_type.stop_play_loop_sound:
                 ClientEvent.dispatchEvent(config.EventRun.NOTICE_EVENT,-11,event)
             break;
+            case config.event_type.switch_scene_event:
+                console.log('切换场景 切换场景 切换场景')
+                // ClientEvent.dispatchEvent(config.EventRun.NOTICE_EVENT,event.event_item_switch_scene_event_data,event)
+            break;
 
         }
         taskServce.exeNextDelayEvent(event)

+ 6 - 0
assets/script/run/gameManager.ts

@@ -223,6 +223,7 @@ export class gameManager extends Component {
         ClientEvent.offAll(config.EventRun.ON_COUNT_DOWN_START)
         ClientEvent.offAll(config.EventRun.ON_SHOW_RULE_BTN)
         ClientEvent.offAll(config.EventRun.ON_BOSS_HURT)
+        ClientEvent.offAll(config.EventRun.MORE_SCENE_DIRECTION_CLICK_FINISH)
 
         ClientEvent.on(config.EventRun.WIDGET_FINISH,this.onWidgetFinishEvent.bind(this),this)
         ClientEvent.on(config.EventRun.WIDGET_FAIL,this.onWidgetFailEvent.bind(this),this)
@@ -231,6 +232,7 @@ export class gameManager extends Component {
         ClientEvent.on(config.EventRun.TOP_VIEW_FAIL,this.onUiFailEvent.bind(this),this)
         ClientEvent.on(config.EventRun.ON_COUNT_DOWN_FAIL,this.onCountDownFailEvent.bind(this),this)
         ClientEvent.on(config.EventRun.ON_COUNT_DOWN_START,this.onStartCountDownEvent.bind(this),this)
+        ClientEvent.on(config.EventRun.MORE_SCENE_DIRECTION_CLICK_FINISH,this.onMoreSceneDirectionClickFinish.bind(this),this)
     }
 
     public initGR(gr:game_run){
@@ -450,6 +452,10 @@ export class gameManager extends Component {
         taskServce.extEventByEventId(event_id)
     }
 
+    onMoreSceneDirectionClickFinish(previous_page: number, cur_page:number, is_up_page:boolean){
+        console.log('多场景方向点击完成   上一页=', previous_page, '当前页数=',cur_page, 'is_up_page=',is_up_page)
+    }
+
     showFindRuleTips(){
         this.mGameRun.showFindRuleTips()
     }

+ 14 - 4
assets/script/run/sceneManager.ts

@@ -90,11 +90,21 @@ export class sceneManager extends Component {
             throw "不可以为空"
         }else{
             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]))
+
+            // 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]))
+            // this.mGameManager.initTaskUi(data._task_data)
+            // this.mGameManager.initCountDownList(gameManager.getCountDownWidgetList(data.page_list[this.mCurPage]))
         }
     }
 }

+ 6 - 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
@@ -141,19 +142,23 @@ export class scene_layer extends Component {
     }
 
     onUp(){
+        let cur_page = this.mCurPage
         let up_page = this.mCurPage -1;
         if(up_page>=0){
             gameManager.Singleton.onLaunch(()=>{
                 this.changePage(up_page)
+                // ClientEvent.dispatchEvent(config.EventRun.MORE_SCENE_DIRECTION_CLICK_FINISH, cur_page, up_page, true)
             })
         }
     }
 
     onNext(){
+        let cur_page = this.mCurPage
         let next_page = this.mCurPage +1;
         if(next_page<this.mScenePages.length){
             gameManager.Singleton.onLaunch(()=>{
                 this.changePage(next_page)
+                // ClientEvent.dispatchEvent(config.EventRun.MORE_SCENE_DIRECTION_CLICK_FINISH, cur_page, next_page, true)
             })
         }
     }

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

@@ -53,14 +53,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;