UIChessLvSel.ts 752 B

123456789101112131415161718192021222324252627
  1. import AudioMng from "../../gcommon/AudioMng";
  2. import GBaseUI from "../../gcommon/GBaseUI";
  3. import { GameMng } from "../../GameMng";
  4. import diffCell from "./diffCell";
  5. import { _decorator,Node,instantiate } from "cc";
  6. const {ccclass, property} = _decorator;
  7. @ccclass
  8. export default class UIDiffSel extends GBaseUI {
  9. public static lvArr=['普通','中等','困难'];
  10. public static selectIndex:number=0;
  11. @property({ type: Node })
  12. public content: Node | null = null;
  13. start(){
  14. for(let i=0;i<UIDiffSel.lvArr.length;i++){
  15. let gnode=instantiate(GameMng.Instance.chessselCell);
  16. gnode.getComponent(diffCell).setData(i);
  17. this.content.addChild(gnode);
  18. }
  19. }
  20. }