ChessRBSel.ts 924 B

12345678910111213141516171819202122232425262728293031
  1. import { UIButton } from "../../gcommon/UIButton";
  2. import GBaseUI from "../../gcommon/GBaseUI";
  3. import GBoardChess from "./GBoardChess";
  4. import { _decorator ,Component,Label,Node,instantiate} from "cc";
  5. // import GameControl = require('../GameControl');
  6. const {ccclass, property} = _decorator;
  7. @ccclass
  8. export default class ChessRBSel extends GBaseUI {
  9. @property(Node)
  10. btred: Node = null;
  11. @property(Node)
  12. btblack: Node = null;
  13. public static selIndex = 0;
  14. public getIndex(){
  15. return
  16. }
  17. start() {
  18. UIButton.BindClick(this.btred, () => {
  19. ChessRBSel.selIndex = 0;
  20. this.node.active=false;
  21. GBoardChess.instance.initChessBoard();
  22. }, this);
  23. UIButton.BindClick(this.btblack, () => {
  24. ChessRBSel.selIndex = 1;
  25. this.node.active=false;
  26. GBoardChess.instance.initChessBoard();
  27. }, this);
  28. }
  29. }