import { _decorator, Label, Node, Sprite } from 'cc'; import { ResKeeper } from '../../../framework/res/ResKeeper'; import { StringUtil } from '../../../framework/util/StringUtil'; import List from '../../../framework/list/List'; const { ccclass, property } = _decorator; @ccclass('HeroFataItem') export class HeroFataItem extends ResKeeper { @property({ type: Sprite, tooltip: "名称背景" }) titleBg: Sprite = null; @property({ type: Label, tooltip: "名称文字" }) titleTx: Label = null; @property({ type: Node, tooltip: "英雄节点" }) itemNode: Node = null; @property({ type: Node, tooltip: "升级按钮" }) updateBtn: Node = null; @property({ type: Label, tooltip: "升级按钮文字" }) updateBtnTx: Label = null; @property({ type: Node, tooltip: "激活按钮" }) activeBtn: Node = null; @property({ type: Label, tooltip: "激活按钮文字" }) activeBtnTx: Label = null; @property({ type: List, tooltip: "描述列表" }) svDesc: List = null; protected onLoad() { this.updateBtnTx.string = StringUtil.getLanguageData('升级'); this.activeBtnTx.string = StringUtil.getLanguageData('激活'); } protected onDestroy() { //如果该组件有事件自行取消注释 //Framework.event.removeEvent(this); super.onDestroy(); } //如果使用了池中的节点,在该函数内归还,该函数会在onDestroy前调用 onClose() { } //UI事件处理 private onTouchButton(event: Event) { //Framework.audio.playEffect(AudioID.Click); let target: any = event.target; } onEventList(item, idx) { // item.getComponent(HeroFateItem).refreshItem(this._equipsData[idx], this._curEquip); } }