| 12345678910111213141516171819202122232425262728 |
- import { _decorator, Button, Component, Node } from 'cc';
- import { UIManager } from './UIManager';
- import ch_audio from '../../ch/audio/audio';
- const { ccclass, property } = _decorator;
- //面板基础类
- @ccclass('BasePanel')
- export class BasePanel extends Component {
- private CloseBtn: Button;//关闭按钮
- onLoad() {
- this.CloseBtn = this.node.getChildByName('Close_Btn').getComponent(Button);
- this.CloseBtn.node.on(Button.EventType.CLICK,this.onClose,this);
- }
- onClose(callback){
- ch_audio.getInstance().playOneShot('Click');
- UIManager.Instance.hideUI(callback);
- }
- onEnter(){
- }
- onExit(){
- }
- }
|