06b11235-f31a-4241-a915-4e424a805bc7.js
1.33 KB
"use strict";
cc._RF.push(module, '06b11I18xpCQakVTkJKgFvH', 'AlertManager');
// script/common/gameplay/managers/AlertManager.ts
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlertManager = void 0;
const simba_cc_resutils_1 = require("simba-cc-resutils");
const AnimationUtils_1 = require("../../utils/AnimationUtils");
class AlertComponent extends cc.Component {
constructor() {
super(...arguments);
this.animate = true;
}
start() {
if (this.animate) {
// this.node.scale = 0.1;
// this.node.runAction(cc.sequence(cc.scaleTo(0.3, 1.1), cc.scaleTo(0.2, 0.9), cc.scaleTo(0.2, 1)));
AnimationUtils_1.AnimationUtils.showUIAnim(this.node.getChildByName("mainNode"), { callback: () => { }, maskNodeOpacityValue: 200 }, this.node.getChildByName("BG"));
}
}
}
var AlertManager;
(function (AlertManager) {
async function showAlert(parent, node, animate = true) {
if (typeof node === "string") {
node = await simba_cc_resutils_1.ResUtils.createWithPrefab(node);
}
let comp = node.addComponent(AlertComponent);
comp.animate = animate;
node.parent = parent;
}
AlertManager.showAlert = showAlert;
})(AlertManager = exports.AlertManager || (exports.AlertManager = {}));
cc._RF.pop();