1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import { _decorator, Component, Node} from 'cc';
- import { config } from './config';
- import { tools } from './tools';
- import { uiManager } from './manager/uiManager';
- import { home } from './ui/home/home';
- import { loading_view } from './ui/loading_view/loading_view';
- const { ccclass, property } = _decorator;
- @ccclass('main')
- export class main extends Component {
- @property(Node) home_node:Node = null;
- @property(Node) ui_parent = null;
- @property(Node) laoding_view_wait = null;
- @property(Node) send_msg_wait = null;
- protected start(): void {
- // game.frameRate = 60;
- // PhysicsSystem2D.instance.fixedTimeStep = 1 / 60;
- tools.init(this.node)
- this.home_node.removeAllChildren()
- uiManager.Instance().init(this.ui_parent,this.laoding_view_wait,this.send_msg_wait)
- this.showLoadingView()
- }
- showLoadingView() {
- uiManager.Instance().showUi(config.UI.loading_view, this.node, (node:Node)=>{
- node.getComponent(loading_view).startLoading(()=>{
- this.showHomeView()
- })
- })
- }
- showHomeView() {
- uiManager.Instance().showUi(config.UI.home,this.home_node,(node:Node)=>{
- node.getComponent(home).init()
- this.home_node.active = true
- })
- }
- }
|