2024-03-19 18:03:50 +08:00
|
|
|
import { _decorator, Node } from 'cc';
|
2024-03-14 14:19:45 +08:00
|
|
|
import { BaseButton } from '../../GlobalScript/CommonComponent/BaseButton';
|
|
|
|
|
import { NpkImage } from '../../Tool/NPKImage';
|
|
|
|
|
import { BaseButtonAction } from '../../GlobalScript/CommonComponent/BaseButtonAction';
|
2024-03-19 18:03:50 +08:00
|
|
|
const { ccclass } = _decorator;
|
2024-03-14 14:19:45 +08:00
|
|
|
|
2024-03-19 18:03:50 +08:00
|
|
|
@ccclass('CloseButtonNode')
|
2024-03-26 17:18:28 +08:00
|
|
|
/**
|
|
|
|
|
* @description: x按钮node
|
|
|
|
|
*/
|
2024-03-19 18:03:50 +08:00
|
|
|
export class CloseButtonNode extends Node {
|
2024-03-14 14:19:45 +08:00
|
|
|
|
|
|
|
|
constructor(onMouseLeftUp?:Function){
|
|
|
|
|
super();
|
|
|
|
|
|
|
|
|
|
/// 给节点添加 button 组件
|
|
|
|
|
const buttonComponent = this.addComponent( BaseButton );
|
2024-03-22 22:56:08 +08:00
|
|
|
buttonComponent.init(NpkImage.ingame,39);
|
2024-03-14 14:19:45 +08:00
|
|
|
|
|
|
|
|
/// 添加点击事件
|
|
|
|
|
const bba = this.addComponent( BaseButtonAction );
|
|
|
|
|
bba.onMouseLeftUp = onMouseLeftUp;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-22 22:56:08 +08:00
|
|
|
}
|
|
|
|
|
|