123456789101112131415161718192021222324252627282930313233 |
- import { UIButton } from "../../gcommon/UIButton";
- import ScenceMng from "../../gcommon/ScenceMng";
- import UIDiffSel from "../DiffSel/UIDiffSel";
- import CanjuModel from "./CanjuModel";
- import { _decorator ,Component,Label,Node} from "cc";
- const {ccclass, property} = _decorator;
- @ccclass
- export default class CellCanJuSel extends Component {
- @property(Node)
- lock:Node=null;
- private index:number=0;
- @property(Label)
- label: Label = null;
- start(){
- UIButton.BindClick(this.node,()=>{
- if(!CanjuModel.Instance.isUnlock(this.index))return;
- CanjuModel.Instance.selectLv=this.index+1;
- UIDiffSel.selectIndex=0;//固定一下难度
- ScenceMng.Instance.load('Chess')
- },this);
-
- }
- setData(i:number){
- this.index=i;
- this.lock.active=!CanjuModel.Instance.isUnlock(this.index);
- this.label.string=""+(i+1);
- }
- }
|