import { _decorator, Component, Node, settings, Animation, Vec3 } from "cc"; import BaseUI from "../base/BaseUI"; import { AbsM, AbsWrapper } from "../web3/AbsM"; import { SceneUtil } from "../../core_tgx/base/SceneUtils"; import { SceneDef } from "../../scripts/SceneDef"; import { BallUISoloMatch } from "./BallUISoloMatch"; import { UIWaiting } from "../../core_tgx/easy_ui_framework/waiting/UIWaiting"; import { Layout } from "cc"; import { ChooseMode } from "./ChooseMode"; import { BallUIRanking } from "./BallUIRanking"; import { BallUITask } from "./BallUITask"; import { BallUIShop } from "./BallUIShop"; import UIUtils from "../base/UIUtils"; import { TopBar } from "../ui_base/TopBar"; import { UserAvatar } from "../ui_base/UserAvatar"; const { ccclass, property } = _decorator; @ccclass("Lobby") export class Lobby extends BaseUI { public static ins: Lobby; private topBar: TopBar; private userAvatar: UserAvatar; public onLoad(): void { super.onLoad(); this.topBar = this.getComponentInChildren(TopBar); this.userAvatar = this.getComponentInChildren(UserAvatar); Lobby.ins = this; let t = new Date().getTime(); console.log("onLoad", t); console.log("onLoad end", new Date().getTime() - t); this.setActive("connect_node", true); this.setActive("gem_node", false); console.log("onLoad end", new Date().getTime() - t); } protected start(): void { this.enter(); } public enter() { this.FindAs("balls_layout", Animation).play(); this.FindAs("bottom_layout", Animation).play(); // UIUtils.MoveXY(this.topBar.node, 0, 200, 0.5, 0); // UIUtils.MoveXY(this.userAvatar.node, 0, 200, 0.5, 0); let gamePassNode = this.FindNode("game_pass_node"); UIUtils.MoveXY(gamePassNode, -500, -100, 0.5, 0); let ball_node = this.FindNode("ball"); ball_node.setScale(0, 0, 0); UIUtils.DelayBezierMoveAndScale( ball_node, ball_node.getPosition(), 1, 0.5, 300 ); let children = this.FindNode("right_layout").children; for (let i = 0; i < children.length; i++) { let child = children[i]; UIUtils.MoveXY(child, 200, 0, 0.5, 100 * i); } } // public setActive(name: string, active: boolean) {} protected simpleOnBtnClick(name: string): void { switch (name) { case "btn_play": ChooseMode.show(); break; case "btn_tab_1": BallUIShop.show(); break; case "btn_tab_2": BallUITask.show(); break; case "btn_tab_3": // BallUIRanking.show(); break; default: break; } } }