HeroFataItem.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { _decorator, Label, Node, Sprite } from 'cc';
  2. import { ResKeeper } from '../../../framework/res/ResKeeper';
  3. import { StringUtil } from '../../../framework/util/StringUtil';
  4. import List from '../../../framework/list/List';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('HeroFataItem')
  7. export class HeroFataItem extends ResKeeper {
  8. @property({ type: Sprite, tooltip: "名称背景" })
  9. titleBg: Sprite = null;
  10. @property({ type: Label, tooltip: "名称文字" })
  11. titleTx: Label = null;
  12. @property({ type: Node, tooltip: "英雄节点" })
  13. itemNode: Node = null;
  14. @property({ type: Node, tooltip: "升级按钮" })
  15. updateBtn: Node = null;
  16. @property({ type: Label, tooltip: "升级按钮文字" })
  17. updateBtnTx: Label = null;
  18. @property({ type: Node, tooltip: "激活按钮" })
  19. activeBtn: Node = null;
  20. @property({ type: Label, tooltip: "激活按钮文字" })
  21. activeBtnTx: Label = null;
  22. @property({ type: List, tooltip: "描述列表" })
  23. svDesc: List = null;
  24. protected onLoad() {
  25. this.updateBtnTx.string = StringUtil.getLanguageData('升级');
  26. this.activeBtnTx.string = StringUtil.getLanguageData('激活');
  27. }
  28. protected onDestroy() {
  29. //如果该组件有事件自行取消注释
  30. //Framework.event.removeEvent(this);
  31. super.onDestroy();
  32. }
  33. //如果使用了池中的节点,在该函数内归还,该函数会在onDestroy前调用
  34. onClose() {
  35. }
  36. //UI事件处理
  37. private onTouchButton(event: Event) {
  38. //Framework.audio.playEffect(AudioID.Click);
  39. let target: any = event.target;
  40. }
  41. onEventList(item, idx) {
  42. // item.getComponent(HeroFateItem).refreshItem(this._equipsData[idx], this._curEquip);
  43. }
  44. }