future 1 năm trước cách đây
mục cha
commit
4ab219b80f

+ 1 - 0
assets/data/data.ts

@@ -438,6 +438,7 @@ export class base_event_item{
 
 export class event_item_fail_event { //失败事件
     public is_relife:boolean = false; //是否可以复活
+    public is_show_animation:boolean = true; //是否显示动画,默认显示
 }
 
 export class event_item_show_scene_title {

+ 2 - 0
assets/edit_game.scene

@@ -177043,6 +177043,7 @@
     "__type__": "15202jfnA9P4JbxFRX7n6Bb",
     "_name": "",
     "_objFlags": 0,
+    "__editorExtras__": {},
     "node": {
       "__id__": 4480
     },
@@ -177874,6 +177875,7 @@
     "__type__": "d2d99A0tkVBfpmYBewJBSP+",
     "_name": "",
     "_objFlags": 0,
+    "__editorExtras__": {},
     "node": {
       "__id__": 543
     },

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 514 - 318
assets/resources/prefab/edit_event.prefab


+ 9 - 20
assets/script/edit/attributes/attributes_count_down.ts

@@ -108,9 +108,6 @@ export class attributes_count_down extends Component {
     }
     public update_att(data:att_count_down){
         this.m_data = data;        
-        console.log(' this.m_data.time_count=', this.m_data.time_count)
-        console.log(' this.m_data.font_info.font_size=', this.m_data.font_info.font_size)
-
         this.ProgressBar_Bg.getComponent(question_btn_info).initView(this.m_data.ProgressBar_Bg,1,null,config.attributes_list_type.count_down)
         this.ProgressBar_Bar.getComponent(question_btn_info).initView(this.m_data.ProgressBar_Bar,2,null,config.attributes_list_type.count_down)
         this.img_text.getComponent(question_btn_info).initView(this.m_data.img_text,3,null,config.attributes_list_type.count_down)
@@ -120,16 +117,12 @@ export class attributes_count_down extends Component {
         this.lab_fail_event.getComponent(Label).string = this.m_data.fail_event_id!=-1?`绑定的id${this.m_data.fail_event_id}`:"无"
         this.lab_start_event.getComponent(Label).string = this.m_data.start_event_id!=-1?`绑定的id${this.m_data.start_event_id}`:"无"
         if(this.m_data.font_info!=undefined&&this.m_data.font_info!=null){
-            if(this.m_data.font_info.font_size==undefined||
-                this.m_data.font_info.font_size==null||
-                isNaN(this.m_data.font_info.font_size)) {
-                this.m_data.font_info.font_size = 20
-            } else {
-                this.m_data.font_info.font_size = parseInt(this.font_size.getComponent(EditBox).string)
-            }
             let color = this.m_data.font_info.font_color;
             this.font_color.getComponent(Sprite).color = new Color(color.r,color.g,color.b);
-            this.font_size.getComponent(EditBox).string = this.m_data.font_info.font_size.toString()
+            let font_size_string = this.m_data.font_info.font_size.toString()
+            if(font_size_string.length > 0) {
+                this.font_size.getComponent(EditBox).string = font_size_string
+            }
         }else{
             this.m_data.font_info = new font_info;
         }
@@ -139,18 +132,14 @@ export class attributes_count_down extends Component {
     change(){
         this.m_data.is_show_time = this.toggle_enbale_time.getComponent(Toggle).isChecked ;
         let down_count_time = this.edit_down_count_time.getComponent(EditBox).string
-        if(this.m_data.font_info!=undefined&&this.m_data.font_info!=null){
-            if(this.m_data.font_info.font_size==undefined||
-                this.m_data.font_info.font_size==null||
-                isNaN(this.m_data.font_info.font_size)) {
-                this.m_data.font_info.font_size = 20
-            }  else {
-                this.m_data.font_info.font_size = parseInt(this.font_size.getComponent(EditBox).string)
-            }
-        }
         if(down_count_time.length>0) {
             this.m_data.time_count = parseInt(down_count_time);
         }
+        let font_size = this.font_size.getComponent(EditBox).string
+        if(font_size.length>0) {
+            this.m_data.font_info.font_size = parseInt(font_size)
+        }
+        
         if(this.call_back!=null){
             this.call_back(this.m_data)
         }

+ 15 - 1
assets/script/edit/event/event_fail_event.ts

@@ -5,13 +5,27 @@ const { ccclass, property } = _decorator;
 @ccclass('event_fail_event')
 export class event_fail_event extends Component {
     @property(Toggle) isReLife:Toggle = null;
+    @property(Toggle) isShowZhuaziAnimation:Toggle = null;
     private m_data:event_item_fail_event = null;
     public initView(data:event_item_fail_event){
         this.m_data = data;
-        this.isReLife.getComponent(Toggle).isChecked = this.m_data.is_relife;
+        this.updateStatus()
+
         this.isReLife.node.on(Toggle.EventType.TOGGLE,()=>{
             this.m_data.is_relife = this.isReLife.getComponent(Toggle).isChecked;
         })
+        this.isShowZhuaziAnimation.node.on(Toggle.EventType.TOGGLE,()=>{
+            this.m_data.is_show_animation = this.isShowZhuaziAnimation.getComponent(Toggle).isChecked;
+        })
+    }
+
+    updateStatus() {
+        this.isReLife.getComponent(Toggle).isChecked = this.m_data.is_relife;
+        if(this.m_data.is_show_animation==undefined||
+            this.m_data.is_show_animation==null) {
+            this.m_data.is_show_animation = true
+        }
+        this.isShowZhuaziAnimation.getComponent(Toggle).isChecked = this.m_data.is_show_animation;
     }
 }
 

+ 13 - 4
assets/script/run/top_layer.ts

@@ -91,10 +91,19 @@ export class top_layer extends Component {
                 }
             }
         }else if(event.type===config.event_type.fail_event){
-            this.fail_ani_view.getComponent(fail_ani).Play()
-            this.scheduleOnce(()=>{
-                this.fail.getComponent(fail).show(event.event_item_fail_event_data.is_relife,this.onClickReLife.bind(this),this.onClickReStart.bind(this))
-            },1.5)
+            console.log('event.event_item_fail_event_data=',event.event_item_fail_event_data)
+            let data = event.event_item_fail_event_data
+            if(data.is_show_animation==undefined||data.is_show_animation==null) {
+                data.is_show_animation = true
+            }
+            if(data.is_show_animation) {
+                this.fail_ani_view.getComponent(fail_ani).Play()
+                this.scheduleOnce(()=>{
+                    this.fail.getComponent(fail).show(event.event_item_fail_event_data.is_relife, this.onClickReLife.bind(this),this.onClickReStart.bind(this))
+                },1.5)
+            } else {
+                this.fail.getComponent(fail).show(event.event_item_fail_event_data.is_relife, this.onClickReLife.bind(this),this.onClickReStart.bind(this))
+            }
         }
     }
 

+ 46 - 12
assets/script/run/ui/fail.ts

@@ -9,37 +9,71 @@ export class fail extends Component {
     @property(Node) btn_fail_reStart:Node = null;
     private m_call_relife = null;
     private m_call_restart = null;
-    public show(is_relife:boolean,call_relife,call_restart){
-        this.node.active = true;
-        this.m_call_relife = call_relife;
-        this.m_call_restart = call_restart;
-        if(is_relife){
-            this.btn_fail_reLife.active = true;
-        }else{
-            this.btn_fail_reLife.active = false;
-        }
+    protected start(): void {
         this.btn_fail_reLife.off(Node.EventType.TOUCH_END)
-        this.btn_fail_reStart.off(Node.EventType.TOUCH_END)
-        this.btn_close.off(Node.EventType.TOUCH_END)
         this.btn_fail_reLife.on(Node.EventType.TOUCH_END,()=>{
             if(this.m_call_relife!=null){
                 this.m_call_relife()
             }
         })
+        this.btn_fail_reStart.off(Node.EventType.TOUCH_END)
         this.btn_fail_reStart.on(Node.EventType.TOUCH_END,()=>{
             if(this.m_call_restart!=null){
                 this.m_call_restart()
             }
         })
+        this.btn_close.off(Node.EventType.TOUCH_END)
         this.btn_close.on(Node.EventType.TOUCH_END,()=>{
             this.node.active = false;
             if(gameManager.Singleton.getLevelData()!=null){
                 gameManager.Singleton.backGameList()
             }
         })
-        gameManager.Singleton.sys_fail_prompt_music()
+    }
 
+    public show(is_relife:boolean,call_relife,call_restart){
+        this.node.active = true;
+        this.m_call_relife = call_relife;
+        this.m_call_restart = call_restart;
+        if(is_relife){
+            this.btn_fail_reLife.active = true;
+        }else{
+            this.btn_fail_reLife.active = false;
+        }
+        gameManager.Singleton.sys_fail_prompt_music()
     }
+
+
+    // public show(is_relife:boolean,call_relife,call_restart){
+    //     this.node.active = true;
+    //     this.m_call_relife = call_relife;
+    //     this.m_call_restart = call_restart;
+    //     if(is_relife){
+    //         this.btn_fail_reLife.active = true;
+    //     }else{
+    //         this.btn_fail_reLife.active = false;
+    //     }
+    //     this.btn_fail_reLife.off(Node.EventType.TOUCH_END)
+    //     this.btn_fail_reStart.off(Node.EventType.TOUCH_END)
+    //     this.btn_close.off(Node.EventType.TOUCH_END)
+    //     this.btn_fail_reLife.on(Node.EventType.TOUCH_END,()=>{
+    //         if(this.m_call_relife!=null){
+    //             this.m_call_relife()
+    //         }
+    //     })
+    //     this.btn_fail_reStart.on(Node.EventType.TOUCH_END,()=>{
+    //         if(this.m_call_restart!=null){
+    //             this.m_call_restart()
+    //         }
+    //     })
+    //     this.btn_close.on(Node.EventType.TOUCH_END,()=>{
+    //         this.node.active = false;
+    //         if(gameManager.Singleton.getLevelData()!=null){
+    //             gameManager.Singleton.backGameList()
+    //         }
+    //     })
+    //     gameManager.Singleton.sys_fail_prompt_music()
+    // }
 }
 
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác