2022-12-16 11:49:52 +01:00

22 lines
780 B
TypeScript

import { instantiate, Prefab, _decorator, Node } from "cc";
import { ModalWindow } from "../../../Services/ModalWindowSystem/ModalWindow";
import { UpgradeUI } from "./UpgradeUI";
const { ccclass, property } = _decorator;
@ccclass("UpgradesModalWindow")
export class UpgradesModalWindow extends ModalWindow<Empty, Empty> {
@property(Prefab) upgradeButtonPrefab: Prefab;
@property(Node) upgradeButtonParent: Node;
public setup(params: Empty): void {
for (let index = 0; index < 6; index++) {
const upgradeButton: Node = instantiate(this.upgradeButtonPrefab);
upgradeButton.getComponent(UpgradeUI).init("Title", "Description", 5);
upgradeButton.setParent(this.upgradeButtonParent);
}
}
}
export class Empty {}