AlertToBeContinueImpl.ts 1.31 KB
import { DummyNode } from "../../../../common/CCDummyObjects";
import { UIManager } from "../../../../common/gameplay/managers/UIManager";
import { AnimationUtils } from "../../../../common/utils/AnimationUtils";
import CCGameCenterNodeFactory from "../../../../cooperation/script/CCGameCenterNodeFactory";
import { GameConfig } from "../../../../GameConfig";
import { GameModelManager } from "../../../model/GameModelManager";

const { ccclass, property } = cc._decorator

@ccclass
export class AlertToBeContinueImpl extends cc.Component {
    @property(cc.Node)
    momentNode: cc.Node = DummyNode;

    onLoad() {
        this.momentNode.addChild(CCGameCenterNodeFactory.getInstance().getMomentNode()!);
    }
    //#region editor bindings
    closeAction() {
        // this.node.destroy();
        AnimationUtils.hideUIAnim(this.node, this.node.getChildByName("mainNode"), {
            callback: () => {
                this.node.destroy();
            }
        }, this.node.getChildByName("BG"))
        GameModelManager.checkAutoPopView();
    }
    //#endregion
}

export async function showToBeContinue() {
    if (!GameConfig.showToBeContinue) {
        GameConfig.showToBeContinue = true;
        await UIManager.showAlert("prefab/ui/ToBeContinue");
        // GameDotMgr.getInstance().dotExposure(ExposureType.Continue);
    }
}