|
@@ -9,13 +9,18 @@ export default class BtnClosePanel extends cc.Component {
|
|
|
|
|
|
|
|
@property({ displayName: '关闭界面', tooltip: '', type: cc.Node })
|
|
@property({ displayName: '关闭界面', tooltip: '', type: cc.Node })
|
|
|
private node_panel: cc.Node = null!;;
|
|
private node_panel: cc.Node = null!;;
|
|
|
|
|
+ @property({ displayName: '点击效果', tooltip: "仅支持 NONE 和 SCALE", type: cc.Enum(cc.Button.Transition) })
|
|
|
|
|
+ public transition_type: cc.Button.Transition = cc.Button.Transition.NONE;
|
|
|
@property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
|
|
@property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
|
|
|
public onComplete: cc.Component.EventHandler[] = [];
|
|
public onComplete: cc.Component.EventHandler[] = [];
|
|
|
|
|
|
|
|
/** 阻断点击 */
|
|
/** 阻断点击 */
|
|
|
public block_click: boolean = false;
|
|
public block_click: boolean = false;
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
- if (!this.node.getComponent(cc.Button)) this.node.addComponent(cc.Button);
|
|
|
|
|
|
|
+ if (!this.node.getComponent(cc.Button)) {
|
|
|
|
|
+ let btn_comp = this.node.addComponent(cc.Button);
|
|
|
|
|
+ btn_comp.transition = this.transition_type;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
start() {
|