import { _decorator, Component, Label, Node } from 'cc'; import { config } from '../config'; const { ccclass, property } = _decorator; @ccclass('select_long_story_level') export class select_long_story_level extends Component { @property(Node) version = null @property(Node) btn_short:Node = null @property(Node) btn_long:Node = null private m_short_cb = null private m_long_cb = null protected start(): void { this.version.getComponent(Label).string = config.version this.btn_short.on(Node.EventType.TOUCH_END,()=>{ if(this.m_short_cb) { this.m_short_cb() } }) this.btn_long.on(Node.EventType.TOUCH_END,()=>{ if(this.m_long_cb) { this.m_long_cb() } }) } initView(short_cb:Function, long_cb: Function) { this.m_short_cb = short_cb this.m_long_cb = long_cb } }