123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import { _decorator, Component, Label, Node, Vec3 } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('fail')
- export class fail extends Component {
- @property(Node) btn_back:Node;
- @property(Node) btn_extend:Node;
- @property(Node) btn_restart:Node;
- @property(Node) lab_restart:Node;
- @property(Node) img_restart_video_icon:Node;
- @property(Node) lab_extend_time:Node;
- @property(Node) lab_title:Node;
- private m_extend_call:any = null;
- private m_restart_call:any = null;
- start() {
- let self = this;
- this.btn_back.on(Node.EventType.TOUCH_START,()=>{
- self.close();
- },this);
- this.btn_extend.on(Node.EventType.TOUCH_START,()=>{
- if(this.m_extend_call!=null){
- this.m_extend_call(this)
- }
- },this);
- this.btn_restart.on(Node.EventType.TOUCH_START,()=>{
- if(this.m_restart_call!=null){
- this.m_restart_call(this)
- }
- },this);
- }
- public close(){
- this.node.removeFromParent();
- }
- //双图找不同
- public showView(extend_time,extend_call,restart,is_show_restart_video){
- this.m_extend_call = extend_call;
- this.m_restart_call = restart;
- this.lab_extend_time.getComponent(Label).string = `延长${extend_time}秒`;
- if(is_show_restart_video===1){
- this.img_restart_video_icon.active = true;
- this.lab_restart.position = new Vec3(-64,0,this.lab_restart.position.z);
- }else{
- this.img_restart_video_icon.active = false;
- this.lab_restart.position = new Vec3(-94,0,this.lab_restart.position.z);
- }
- }
- public showDDZView(restart,is_show_restart_video){
- this.m_restart_call = restart;
- this.btn_extend.active = false;
- this.lab_title.getComponent(Label).string = "失败!"
- if(is_show_restart_video===1){
- this.img_restart_video_icon.active = true;
- this.lab_restart.position = new Vec3(-64,0,this.lab_restart.position.z);
- }else{
- this.img_restart_video_icon.active = false;
- this.lab_restart.position = new Vec3(-94,0,this.lab_restart.position.z);
- }
- }
- }
|