mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 08:36:14 +00:00
new upgrades, restrucutre
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, ProgressBar, _decorator } from "cc";
|
||||
import { Player } from "../Player/Player";
|
||||
import { UnitLevel } from "../Player/UnitLevel";
|
||||
import { Player } from "../Unit/Player/Player";
|
||||
import { UnitLevel } from "../Unit/Player/UnitLevel";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GameUI")
|
||||
|
@@ -31,7 +31,7 @@ export class LevelUpModalWindow extends ModalWindow<UpgradeType[], UpgradeType>
|
||||
}
|
||||
}
|
||||
|
||||
private chooseSkill(skill: LevelUpSkill): void {
|
||||
this.dismiss(UpgradeType.WeaponDamage);
|
||||
private chooseSkill(upgradeType: UpgradeType): void {
|
||||
this.dismiss(upgradeType);
|
||||
}
|
||||
}
|
||||
|
@@ -7,17 +7,20 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass("LevelUpSkill")
|
||||
export class LevelUpSkill extends Component {
|
||||
@property(Label) private skillTitle: Label;
|
||||
private chooseSkillEvent: Signal<LevelUpSkill> = new Signal<LevelUpSkill>();
|
||||
private chooseSkillEvent: Signal<UpgradeType> = new Signal<UpgradeType>();
|
||||
private skillType: UpgradeType;
|
||||
|
||||
public init(skillType: UpgradeType): void {
|
||||
this.skillType = skillType;
|
||||
this.skillTitle.string = `Skill ${skillType}`;
|
||||
this.node.on(NodeEventType.MOUSE_DOWN, this.chooseSkill, this);
|
||||
}
|
||||
|
||||
public get ChooseSkillEvent(): ISignal<LevelUpSkill> {
|
||||
public get ChooseSkillEvent(): ISignal<UpgradeType> {
|
||||
return this.chooseSkillEvent;
|
||||
}
|
||||
|
||||
private chooseSkill(): void {
|
||||
this.chooseSkillEvent.trigger(this);
|
||||
this.chooseSkillEvent.trigger(this.skillType);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user