mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-08 16:15:59 +00:00
Icons
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user