Start.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { _decorator, Component, Node } from 'cc';
  2. import { UIBase, UIType } from '../GameFrameWork/UIBase';
  3. import { UIMgr } from '../../Frames/UIManager';
  4. import { dataMgr } from '../../Frames/DataManager';
  5. import { RoleData } from '../../DataItem/ItemData';
  6. const { ccclass, property } = _decorator;
  7. @ccclass('Start')
  8. export class Start extends UIBase {
  9. protected onStart() {
  10. this.onBtnClick("_btnStart", this._btnStart);
  11. this.onBtnClick("_btnMusic", this._btnMusic);
  12. this.onBtnClick("_btnVolume", this._btnVolume)
  13. }
  14. update(deltaTime: number) {
  15. }
  16. private _btnStart() {
  17. this.hide(false);
  18. //UIMgr.openUI("BattleSceneSelect");
  19. UIMgr.openUI("BattleScene_Left", UIType.WIDGET);
  20. UIMgr.openUI("BattleScene_Right", UIType.WIDGET);
  21. UIMgr.openUI("BattleScene_Top", UIType.WIDGET);
  22. }
  23. private _btnMusic() {
  24. // let _roleData: RoleData[] = null;
  25. // _roleData = dataMgr.getAllDataByName("RoleCardData");
  26. // _roleData.forEach((values,index)=>{
  27. // this.createRoleCard(index)
  28. // })
  29. //console.log(_roleData);
  30. }
  31. // createRoleCard(id: number){
  32. // console.log(id)
  33. // }
  34. private _btnVolume() {
  35. console.log("Volume");
  36. }
  37. }