1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import ChessMng, { ChessType } from "../Game/DiffSel/ChessMng";
- import AudioMng from "../gcommon/AudioMng";
- import { UIButton } from "../gcommon/UIButton";
- import ScenceMng from "../gcommon/ScenceMng";
- import { GameMng } from "../GameMng";
- import { _decorator,Component,director } from "cc";
- const {ccclass, property} = _decorator;
- @ccclass
- export default class UIButtonBack extends Component {
- start () {
- UIButton.BindClick(this.node,()=>{
- let sname=director.getScene().name;
- console.log(sname);
- if(sname=='ChessDiffSel'||sname=="ChessCanJuSel"){
-
- ScenceMng.Instance.load('GameLaunch');
- }
- else if(sname=="Chess"){
- AudioMng.Instance.PlayBGM(GameMng.Instance.mainbgm);
- ScenceMng.Instance.load('GameLaunch');
- // switch (ChessMng.Instance.chesstype) {
- // case ChessType.renjiboyi:
- // return ScenceMng.Instance.load('ChessDiffSel');
- // case ChessType.canju:
- // return ScenceMng.Instance.load('ChessCanJuSel');
- // }
-
- }
-
- },this);
- }
- // update (dt) {}
- }
|