Files
2026-11-20 20:32:40 +08:00

18 lines
747 B
TypeScript

import { _decorator, Color, Component, Graphics, Node } from 'cc';
import { drawCelebrationGraphics } from './DialogCelebration';
const { ccclass } = _decorator;
/** Graphics的路径不序列化;仅重绘已有节点,不创建运行时UI。 / Redraw saved graphics nodes because drawing commands are not serialized. */
@ccclass('DialogEffects')
export class DialogEffects extends Component {
onLoad(): void {
const shade = this.node.getChildByName('Shade')?.getComponent(Graphics);
if (shade) {
shade.clear(); shade.fillColor = new Color(12, 0, 22, 155);
shade.rect(-10000, -10000, 20000, 20000); shade.fill();
}
const parent = this.node.getChildByName('BonusAwardDialog');
if (parent) drawCelebrationGraphics(parent);
}
}