You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
4.7 KiB
89 lines
4.7 KiB
|
1 week ago
|
|
||
|
|
//*********************
|
||
|
|
// create by 流云
|
||
|
|
// 插件自动生成的节点脚本
|
||
|
|
// 请勿修改(自动生成会覆盖)
|
||
|
|
// 请通过子类继承使用
|
||
|
|
// 如何生成可直接调用的UI节点和组件?
|
||
|
|
// 1.在场景节点树中选中要生成的UI根节点
|
||
|
|
// 2.点击菜单"tool"->“生成UI脚本” 或者使用快捷键(快捷键:Ctrl+Shift+C)
|
||
|
|
// 3.点击后会在script/ui/目录中生成一个以选中节点命名的文件夹,文件夹中会生成两个脚本文件,“Auto_”开头的就是本文件,不可修改,另一个是“UI”+选中节点名称命名的脚本文件,可修改,是需要挂载到选中节点的脚本文件,给用户使用的写逻辑的脚本,只会生成一次
|
||
|
|
// 4.找到第3步描述的“UI”+选中节点名称命名的脚本文件,将其挂载到选中节点上(第一生成需要挂载,后续修改场景,重复生成的时候,该脚本不会再生成,不用担心会覆盖逻辑脚本)
|
||
|
|
// 下面是类型示例
|
||
|
|
// 1.按钮,节点名以“btn_”或者“Btn_”开头或者节点添加了Button组件, 例:btn_Close,会生成btn_Close节点和click_btn_Close()方法
|
||
|
|
// 2.标签,节点名以“lb_”开头, 例:lb_title,会生成lb_title的Label组件
|
||
|
|
// 3.输入框,节点名以“eb_”开头, 例:eb_input,会生成eb_input的EditBox组件
|
||
|
|
// 4.滚动视图,节点名以“sv_”开头, 例:sv_list,会生成sv_list的ScrollView组件
|
||
|
|
// 5.图片,节点名以“img_”或者sp_“”开头, 例:img_Icon,会生成img_Icon的Sprite组件
|
||
|
|
// 6.普通节点,节点名以“ui_”或者“Ui_”或者“UI_”开头, 例:ui_Content,会生成ui_Content的Node节点
|
||
|
|
//*********************
|
||
|
|
import { _decorator, Component, Node, find, Sprite, Label, Button, ScrollView, EditBox, RichText } from 'cc';
|
||
|
|
import { UIBase } from '../../../mx/module/ui/UIBase';
|
||
|
|
const { ccclass } = _decorator;
|
||
|
|
|
||
|
|
@ccclass('Auto_ReplicaBox')
|
||
|
|
export class Auto_ReplicaBox extends UIBase {
|
||
|
|
bgMask:Node;
|
||
|
|
ui_center:Node;
|
||
|
|
lb_name:Label;
|
||
|
|
ui_titleBg:Node;
|
||
|
|
ui_finish:Node;
|
||
|
|
ui_unlock:Node;
|
||
|
|
ui_difficultybg:Node;
|
||
|
|
ui_selectDiff:Node;
|
||
|
|
btnRight:Node;
|
||
|
|
btnLeft:Node;
|
||
|
|
ui_difficut:Node;
|
||
|
|
ui_layNode:Node;
|
||
|
|
btnClose:Node;
|
||
|
|
btnTiaozhan:Node;
|
||
|
|
lb_needTili:Label;
|
||
|
|
btnSweep:Node;
|
||
|
|
lb_tiaozhan:Label;
|
||
|
|
lb_desc:Label;
|
||
|
|
ui_tipDesLab:Node;
|
||
|
|
onLoad(){
|
||
|
|
super.onLoad();
|
||
|
|
this.bgMask = find("bgMask",this.node);
|
||
|
|
this.ui_center = find("ui_center",this.node);
|
||
|
|
this.lb_name = find("ui_center/lb_name",this.node)?.getComponent(Label);
|
||
|
|
this.ui_titleBg = find("ui_center/ui_titleBg",this.node);
|
||
|
|
this.ui_finish = find("ui_center/ui_finish",this.node);
|
||
|
|
this.ui_unlock = find("ui_center/ui_unlock",this.node);
|
||
|
|
this.ui_difficultybg = find("ui_center/ui_difficultybg",this.node);
|
||
|
|
this.ui_selectDiff = find("ui_center/ui_selectDiff",this.node);
|
||
|
|
this.btnRight = find("ui_center/ui_selectDiff/btnRight",this.node);
|
||
|
|
this.btnLeft = find("ui_center/ui_selectDiff/btnLeft",this.node);
|
||
|
|
this.ui_difficut = find("ui_center/ui_selectDiff/ui_difficut",this.node);
|
||
|
|
this.ui_layNode = find("ui_center/ui_layNode",this.node);
|
||
|
|
this.btnClose = find("ui_center/btnClose",this.node);
|
||
|
|
this.btnTiaozhan = find("ui_center/btns/btnTiaozhan",this.node);
|
||
|
|
this.lb_needTili = find("ui_center/btns/btnTiaozhan/lb_needTili",this.node)?.getComponent(Label);
|
||
|
|
this.btnSweep = find("ui_center/btns/btnSweep",this.node);
|
||
|
|
this.lb_tiaozhan = find("ui_center/layouyLa/lb_tiaozhan",this.node)?.getComponent(Label);
|
||
|
|
this.lb_desc = find("ui_center/lb_desc",this.node)?.getComponent(Label);
|
||
|
|
this.ui_tipDesLab = find("ui_center/ui_tipDesLab",this.node);
|
||
|
|
}
|
||
|
|
onEnable() {
|
||
|
|
this.bgMask.on(Node.EventType.TOUCH_END, this.click_bgMask, this);
|
||
|
|
this.btnRight.on(Node.EventType.TOUCH_END, this.click_btnRight, this);
|
||
|
|
this.btnLeft.on(Node.EventType.TOUCH_END, this.click_btnLeft, this);
|
||
|
|
this.btnClose.on(Node.EventType.TOUCH_END, this.click_btnClose, this);
|
||
|
|
this.btnTiaozhan.on(Node.EventType.TOUCH_END, this.click_btnTiaozhan, this);
|
||
|
|
this.btnSweep.on(Node.EventType.TOUCH_END, this.click_btnSweep, this);
|
||
|
|
}
|
||
|
|
onDisable() {
|
||
|
|
this.bgMask.off(Node.EventType.TOUCH_END, this.click_bgMask, this);
|
||
|
|
this.btnRight.off(Node.EventType.TOUCH_END, this.click_btnRight, this);
|
||
|
|
this.btnLeft.off(Node.EventType.TOUCH_END, this.click_btnLeft, this);
|
||
|
|
this.btnClose.off(Node.EventType.TOUCH_END, this.click_btnClose, this);
|
||
|
|
this.btnTiaozhan.off(Node.EventType.TOUCH_END, this.click_btnTiaozhan, this);
|
||
|
|
this.btnSweep.off(Node.EventType.TOUCH_END, this.click_btnSweep, this);
|
||
|
|
}
|
||
|
|
click_bgMask() {}
|
||
|
|
click_btnRight() {}
|
||
|
|
click_btnLeft() {}
|
||
|
|
click_btnClose() {}
|
||
|
|
click_btnTiaozhan() {}
|
||
|
|
click_btnSweep() {}
|
||
|
|
}
|