This commit is contained in:
Martin
2022-12-22 14:05:31 +01:00
parent 8b2897f38b
commit f15f654ac6
9 changed files with 464 additions and 35 deletions

View File

@@ -10,6 +10,11 @@ export class GameAssets extends Component {
@property(MetaUpgradeIcons) private metaUpgradeIcons: MetaUpgradeIcons;
@property(AudioAssets) private audioAssets: AudioAssets;
public init(): void {
this.upgradeIcons.init();
this.metaUpgradeIcons.init();
}
public get UpgradeIcons(): UpgradeIcons {
return this.upgradeIcons;
}

View File

@@ -1,4 +1,5 @@
import { Component, Label, NodeEventType, _decorator } from "cc";
import { approx, Component, Label, NodeEventType, Sprite, _decorator } from "cc";
import { AppRoot } from "../../../AppRoot/AppRoot";
import { ISignal } from "../../../Services/EventSystem/ISignal";
import { Signal } from "../../../Services/EventSystem/Signal";
import { TranslationData } from "../../Data/TranslationData";
@@ -8,12 +9,16 @@ const { ccclass, property } = _decorator;
@ccclass("LevelUpSkill")
export class LevelUpSkill extends Component {
@property(Label) private skillTitle: Label;
@property(Label) private skillDescription: Label;
@property(Sprite) private skillIcon: Sprite;
private chooseSkillEvent: Signal<UpgradeType> = new Signal<UpgradeType>();
private skillType: UpgradeType;
public init(skillType: UpgradeType, translationData: TranslationData): void {
this.skillType = skillType;
this.skillTitle.string = `${translationData[`${skillType}_TITLE`]}`;
this.skillDescription.string = `${translationData[`${skillType}_DESC`]}`;
this.skillIcon.spriteFrame = AppRoot.Instance.GameAssets.UpgradeIcons.getIcon(skillType);
this.node.on(NodeEventType.TOUCH_START, this.chooseSkill, this);
}