1234567891011121314151617181920212223242526272829303132333435 |
- import { _decorator, Component, director, Node } from 'cc';
- import { UI_Hall } from '../module_game/ui/UI_Hall/UI_Hall';
- import { gui } from '../core/ui/ui';
- import PlayerData from '../module_game/game/PlayerData';
- import { ch } from '../ch/ch';
- import get_new_head_icon from '../core/util_class/HeadIcon';
- const { ccclass, property } = _decorator;
- @ccclass('Hall')
- export class Hall extends Component {
- private static instance: Hall;
- public player:PlayerData;
- public head_icon=get_new_head_icon();
- public static getInstance():Hall{
- return Hall.instance;
- }
- start() {
- if(!Hall.instance){
- Hall.instance=this;
- }
- gui.show(UI_Hall);
- director.addPersistRootNode(this.node);
- this.init();
- }
- async init(){
- this.player = PlayerData.getInstance(ch.sdk.get_gid(), ch.sdk.get_uid().toString());
- this.player.init_user_info();
- await this.player.load();
- }
- }
|