tongqianCreate.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { _decorator, Component, Node } from 'cc';
  2. import { ClientEvent } from '../clientEvent';
  3. import { Constant, matching_5_10_20_type, room_type } from '../constant';
  4. import ChessMng, { ChessType } from '../Game/DiffSel/ChessMng';
  5. import { GameMng } from '../GameMng';
  6. import ScenceMng from '../gcommon/ScenceMng';
  7. import { UIButton } from '../gcommon/UIButton';
  8. import { UIManager } from '../gcommon/UIManager';
  9. import { native_manager } from '../native_manager';
  10. import { msgManager } from '../socket/msgManager';
  11. import { roomData } from '../UserData/roomData';
  12. const { ccclass, property } = _decorator;
  13. @ccclass('tongqianCreate')
  14. export class tongqianCreate extends Component {
  15. @property(Node)
  16. btn_chuji: Node = null; //
  17. @property(Node)
  18. btn_zhongji: Node = null; //
  19. @property(Node)
  20. btn_gaoji: Node = null; //
  21. @property(Node)
  22. btn_ads_tongqian: Node = null; //
  23. start() {
  24. let self = this;
  25. UIButton.BindClick(this.btn_chuji,()=>{
  26. this.sendMsg(room_type._chuji_tongqian)
  27. },this)
  28. UIButton.BindClick(this.btn_zhongji,()=>{
  29. this.sendMsg(room_type._zhongji_tongqian)
  30. },this)
  31. UIButton.BindClick(this.btn_ads_tongqian,()=>{
  32. native_manager.showRewardVideo()
  33. },this)
  34. }
  35. sendMsg(type:room_type){
  36. switch (type) {
  37. case room_type._chuji_tongqian:
  38. msgManager.createRoomByRoomType(room_type._chuji_tongqian)
  39. break;
  40. case room_type._zhongji_tongqian:
  41. msgManager.createRoomByRoomType(room_type._zhongji_tongqian)
  42. break;
  43. }
  44. UIManager.AddPrefab(GameMng.Instance.uiloading)
  45. }
  46. onDestroy(){
  47. }
  48. }