import { _decorator, Component, instantiate, Node,Prefab ,Button,AudioClip,AudioSource} from 'cc'; const { ccclass, property } = _decorator; import { Item } from './Item'; import { GameManager } from './Manager/GameManager'; @ccclass('Game') export class Game extends Component { @property({type:Prefab}) preBlock = null private row:number=13; private col:number=12; private lockArr:Item[]; private itemDic={}; @property({type:[AudioClip]})// 晋级 选择颜色 结束 otherAudioArr = [] audioSource: AudioSource; start() { this.audioSource = this.node.getComponent(AudioSource) this.lockArr=[]; this.createItems(); for(let i=1;i<=4;i++){ this.node.getChildByPath("Btns/Button_"+i).on(Button.EventType.CLICK, this.callback, this); } } reset(): void { this.lockArr=[]; this.itemDic={} this.node.getChildByName("Con").removeAllChildren() this.createItems(); } callback (button: Button) { let number=Number(button.name.replace("