06b11235-f31a-4241-a915-4e424a805bc7.js
1.07 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 ResUtils_1 = require("../../utils/ResUtils");
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)));
}
}
}
var AlertManager;
(function (AlertManager) {
async function showAlert(parent, node, animate = true) {
if (typeof node === "string") {
node = await 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();