import AudioMng from "../../gcommon/AudioMng"; import { UIButton } from "../../gcommon/UIButton"; import GameData from "../../gcommon/GameData"; import ScenceMng from "../../gcommon/ScenceMng"; import { GameMng } from "../../GameMng"; import CanjuModel from "../ChessCanJuSel/CanjuModel"; import UICanJuSel from "../ChessCanJuSel/UICanJuSel"; import ChessMng, { ChessType } from "../DiffSel/ChessMng"; import UIDiffSel from "../DiffSel/UIDiffSel"; import GBoardChess from "./GBoardChess"; import { Vec3,tween,UITransform ,_decorator ,Component,Label,Node,instantiate,Animation,Prefab,Sprite, director, Director} from "cc"; const {ccclass, property} = _decorator; @ccclass export default class UIEndChess extends Component { @property(Animation) winAnimation:Animation=null; @property(Animation) failAnimation:Animation=null; @property(Node) btnRestart: Node = null; @property(Node) btnMoreLv: Node = null; @property(Node) btnback: Node = null; @property(Node) winSp: Node = null; @property(Node) failSp: Node = null; @property(Label) endtimelabel: Label = null; @property(Label) bushulabel: Label = null; start(){ UIButton.BindClick(this.btnMoreLv, () => { if(ChessMng.Instance.chesstype==ChessType.renjiboyi) UIDiffSel.selectIndex++; else if(ChessMng.Instance.chesstype==ChessType.canju){ CanjuModel.Instance.selectNextLv(); } this.node.active=false; GBoardChess.instance.restartGame(); }, this); UIButton.BindClick(this.btnRestart, () => { this.node.active=false; GBoardChess.instance.restartGame(); }, this); } setData(result:number,time:string,bushu:number){ this.endtimelabel.string=time; this.bushulabel.string=bushu.toString(); if(result==0){ AudioMng.Instance.PlaySoundByName(GameMng.Instance.winclip); this.winSp.active=true; this.failSp.active=false; this.winAnimation.play('win'); if(ChessMng.Instance.chesstype==ChessType.renjiboyi) { if(UIDiffSel.selectIndex