future 1 rok temu
rodzic
commit
053dd54b7f

+ 0 - 1
assets/data/data.ts

@@ -21,7 +21,6 @@ export class attributes_data{
     public src_name:string = "";
     public ani:string = "";
     public scene_rule_tips_data:scene_tips_rule_data = new scene_tips_rule_data; //场景的规则和提示
-    public scene_more_scene_show_arrow:boolean = false;  //场景多场景显示箭头
     public edit_active:boolean = true;  //是否激活
     public is_interaction:boolean = true;  //开启交互
     public is_show:boolean = true; //默认显示

+ 21 - 21
assets/edit_game.scene

@@ -116,7 +116,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 959.9999999999999,
+      "x": 960,
       "y": 960,
       "z": 0
     },
@@ -206,8 +206,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1919.9999999999998,
-      "height": 1919.9999999999998
+      "width": 1920,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -344,7 +344,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 959.9999999999999,
+    "_orthoHeight": 963.047619047619,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -533,8 +533,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 839.9999999999997,
-      "height": 1919.9999999999998
+      "width": 840,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -7333,7 +7333,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -509.9999999999999,
+      "y": -510,
       "z": 0
     },
     "_lrot": {
@@ -7390,7 +7390,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 419.99999999999983,
+      "x": 420,
       "y": 0,
       "z": 0
     },
@@ -7790,7 +7790,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 799.9999999999997,
+      "width": 800,
       "height": 860
     },
     "_anchorPoint": {
@@ -7908,7 +7908,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -284.99999999999983,
+      "x": -285,
       "y": -105,
       "z": 0
     },
@@ -8191,7 +8191,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 799.9999999999997,
+      "width": 800,
       "height": 210
     },
     "_anchorPoint": {
@@ -8275,7 +8275,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 839.9999999999997,
+      "width": 840,
       "height": 900
     },
     "_anchorPoint": {
@@ -18555,8 +18555,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 839.9999999999997,
-      "height": 1919.9999999999998
+      "width": 840,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -20450,7 +20450,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 750.133,
+      "x": 750.1330000000002,
       "y": 0,
       "z": 0
     },
@@ -178083,8 +178083,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 419.99999999999943,
-      "height": 1869.9999999999998
+      "width": 419.9999999999998,
+      "height": 1870
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -178308,8 +178308,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 419.99999999999943,
-      "height": 1919.9999999999998
+      "width": 419.9999999999998,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -180932,8 +180932,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1919.9999999999998,
-      "height": 1919.9999999999998
+      "width": 1920,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 1 - 0
assets/script/config.ts

@@ -192,6 +192,7 @@ export class config {
         remark:"remark",
         rotation:"rotation",
         anchor:"anchor",
+        show_more_scene_arrow:"show_more_scene_arrow",
     }
 
     static last_id:number = 0;

+ 3 - 2
assets/script/edit/Attributes.ts

@@ -60,6 +60,7 @@ export class Attributes extends Component {
     private cur_att_data:attributes_data = null;
     private _main:main = null;
     public static Singleton:Attributes = null;
+    public static is_show_more_scene_arrow:boolean = true; //是否显示多场景箭头
     start() {
         Attributes.Singleton = this;
         ClientEvent.on(config.Event.UpdateAttributes,this.UpdateAttributes,this)
@@ -134,7 +135,7 @@ export class Attributes extends Component {
     }
 
     onChangSceneAttributesStatus(data:attributes_data) {
-        ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.scene_rule_tips)
+        ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.show_more_scene_arrow)
     }
 
     onChangShowStatus(show:boolean){
@@ -391,7 +392,7 @@ export class Attributes extends Component {
             
             let scene_set = this.getSceneSetingCom()
             if(this.cur_att_data.type===config.attributes_type.scene){
-                scene_set.update_att_info(this.cur_att_data)
+                scene_set.update_att_info(this._main, this.cur_att_data)
                 if(this.cur_att_data.scene_rule_tips_data!=null){
                     scene_set.update_att(this.cur_att_data.scene_rule_tips_data)
                 }else{

+ 12 - 7
assets/script/edit/attributes/attributes_scene_setting.ts

@@ -1,7 +1,9 @@
 import { _decorator, Component, EditBox, instantiate, Node, Prefab, Toggle } from 'cc';
-import { attributes_data, scene_tips_rule_data, ui_att_item } from '../../../data/data';
+import { attributes_data, scene_item_data, scene_tips_rule_data, ui_att_item } from '../../../data/data';
 import { scene_tips_rule_item } from './scene_tips_rule_item';
 import { config } from '../../config';
+import { Attributes } from '../Attributes';
+import { main } from '../../main';
 const { ccclass, property } = _decorator;
 
 @ccclass('attributes_scene_setting')
@@ -36,21 +38,24 @@ export class attributes_scene_setting extends Component {
         })
 
         this.toggle_show_arrow.node.on(Toggle.EventType.TOGGLE, ()=>{
-            this.m_attributes_data.scene_more_scene_show_arrow = !this.m_attributes_data.scene_more_scene_show_arrow
+            Attributes.is_show_more_scene_arrow = !Attributes.is_show_more_scene_arrow
             if(this.m_attributes_call!=null) {
                 this.m_attributes_call(this.m_attributes_data)
             }
         })
     }
 
-    public update_att_info(data:attributes_data){
+    public update_att_info(_main:main, data:attributes_data){
         this.m_attributes_data = data
+        let cur_scene_data = _main.edit_scene_view.getCurSelectScene()
         if(this.m_attributes_data.type===config.attributes_type.scene) {
-            this.show_arrow_node.active = true
-            if(this.m_attributes_data.scene_more_scene_show_arrow==undefined) {
-                this.m_attributes_data.scene_more_scene_show_arrow = true
+            if(cur_scene_data.type == config.Scene_Type_List.many_screen_switch_up_down||
+                cur_scene_data.type == config.Scene_Type_List.many_screen_switch_left_right) {
+                    this.show_arrow_node.active = true
+                    this.toggle_show_arrow.isChecked = Attributes.is_show_more_scene_arrow
+            } else {
+                this.show_arrow_node.active = false
             }
-            this.toggle_show_arrow.isChecked = this.m_attributes_data.scene_more_scene_show_arrow
         } else {
             this.show_arrow_node.active = false
         }

+ 51 - 28
assets/script/edit/base_view.ts

@@ -8,6 +8,7 @@ import { tools } from '../tools';
 import { cur_edit_scene } from './cur_edit_scene';
 import { widget_item } from './widget_item';
 import { ClientEvent } from '../clientEvent';
+import { Attributes } from './Attributes';
 const { ccclass, property } = _decorator;
 
 @ccclass('base_view')
@@ -52,11 +53,16 @@ export class base_view extends Component {
             this.next_page()
         })
         this.updatePageNumber()
+        if(Attributes.is_show_more_scene_arrow==false) {
+            this.hideAllBtn()
+        }
         ClientEvent.on(config.Event.ChangeSelectPage,this.ChangeSelectPage,this)
+        ClientEvent.on(config.Event.UpdateAttributesToView,this.ChangeArrow,this)
     }
 
     protected onDestroy(): void {
         ClientEvent.off(config.Event.ChangeSelectPage,this.ChangeSelectPage,this)
+        ClientEvent.off(config.Event.UpdateAttributesToView,this.ChangeArrow,this)
     }
 
     ChangeSelectPage(page:number){
@@ -66,6 +72,16 @@ export class base_view extends Component {
         }
     }
 
+    ChangeArrow(data:attributes_data,update_type:string) {
+        if(update_type==config.attributes_list_type.show_more_scene_arrow){
+            if(Attributes.is_show_more_scene_arrow) {
+                this.showBtn()
+            } else {
+                this.hideAllBtn()
+            }
+        }
+    }
+
     public getAtt(){
 
     }
@@ -195,34 +211,7 @@ export class base_view extends Component {
         this.updatePageView()
         this.m_edit_scene.cur_edit_scene_node.getComponent(cur_edit_scene).onClickScene() 
 
-        if(this.m_data.type == config.Scene_Type_List.many_screen_switch_up_down) {
-            if(this.m_data.page_list.length == 0) {
-                this.btn_up.active = true
-                this.btn_down.active = true
-                return
-            }
-            this.btn_up.active = true
-            this.btn_down.active = true
-            if(this.m_cur_page==0) {
-                this.btn_up.active = false
-            } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
-                this.btn_down.active = false
-            }
-            
-        } else if(this.m_data.type == config.Scene_Type_List.many_screen_switch_left_right) {
-            if(this.m_data.page_list.length == 0) {
-                this.btn_left.active = true
-                this.btn_right.active = true
-                return
-            }
-            this.btn_left.active = true
-            this.btn_right.active = true
-            if(this.m_cur_page==0) {
-                this.btn_left.active = false
-            } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
-                this.btn_right.active = false
-            }
-        }
+        this.showBtn()
     }
 
     updatePageView(){
@@ -297,6 +286,40 @@ export class base_view extends Component {
 
     }
 
+    showBtn() {
+        if(Attributes.is_show_more_scene_arrow==false) {
+            return
+        }
+        if(this.m_data.type == config.Scene_Type_List.many_screen_switch_up_down) {
+            if(this.m_data.page_list.length == 0) {
+                this.btn_up.active = true
+                this.btn_down.active = true
+                return
+            }
+            this.btn_up.active = true
+            this.btn_down.active = true
+            if(this.m_cur_page==0) {
+                this.btn_up.active = false
+            } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
+                this.btn_down.active = false
+            }
+            
+        } else if(this.m_data.type == config.Scene_Type_List.many_screen_switch_left_right) {
+            if(this.m_data.page_list.length == 0) {
+                this.btn_left.active = true
+                this.btn_right.active = true
+                return
+            }
+            this.btn_left.active = true
+            this.btn_right.active = true
+            if(this.m_cur_page==0) {
+                this.btn_left.active = false
+            } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
+                this.btn_right.active = false
+            }
+        }
+    }
+
     hideAllBtn(){
         this.btn_down.active = false;
         this.btn_up.active = false;

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

@@ -38,6 +38,7 @@ export class scene_layer extends Component {
         this.mScenePages = pages;
         this.initSceneDir(type)
         this.loadAllPage()
+        this.changeHideAllDirectionBtn()
     }
 
     public unInit(){
@@ -88,13 +89,12 @@ export class scene_layer extends Component {
         }else if(event.type===config.event_type.more_scene_is_show_arrow_event) {
             let data = event.event_item_more_scene_is_show_arrow_event_data
             if(data!=null) {
+                this.is_show_cur_directionBtn = data.is_show
                 if(data.is_show) {
-                    this.is_show_cur_directionBtn = true
                     this.changeUpNextDirectionBtn()
                 } else {
                     this.changeHideAllDirectionBtn()
                 }
-                this.is_show_cur_directionBtn = data.is_show
                 gameManager.Singleton.exeNextDelayEvent(event)
             }
         }else if(event.type===config.event_type.more_scene_jump_assigned_page_event){
@@ -148,9 +148,6 @@ export class scene_layer extends Component {
     }
 
     changeHideAllDirectionBtn(){
-        if(this.is_show_cur_directionBtn==false) {
-            return
-        }
         this.scenePageDir.getComponent(scene_page_dir).hideAllBtn()
     }