import { _decorator, Component, Node } from 'cc'; import { Difficulty, SuperFind } from '../../script/Manager/LocalDataMgr'; import EventMgr from '../../script/Manager/EventMgr'; const { ccclass, property } = _decorator; @ccclass('AddCountPanel') export class AddCountPanel extends Component { @property(Node) btnClose:Node = null start() { this.btnClose.on(Node.EventType.TOUCH_END,this.close,this) } close() { this.node.active = false } AddCount(event,customEventData) { let count = Number(customEventData) Difficulty.difficutyData.difficutyCount += count if(Difficulty.difficutyData.difficutyCount > 30) { Difficulty.difficutyData.difficutyCount = 30 } Difficulty.createOrDeleteOtherScale(); Difficulty.saveDifficutyData(); SuperFind.setTitle() EventMgr.ins.dispatchEvent("refreshLevelInfo") this.node.active = false EventMgr.ins.dispatchEvent("regenerate") } }