mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-01-15 07:21:27 +00:00
22 lines
780 B
TypeScript
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 {}
|