MouseIconDetailItem.ts 695 B

12345678910111213141516171819202122232425262728
  1. import { MouseConst } from "./MouseConst";
  2. import MouseIconDetail from "./MouseIconDetail";
  3. const { ccclass, property } = cc._decorator;
  4. @ccclass
  5. export default class MouseDetailsItem extends cc.Component {
  6. @property(sp.Skeleton)
  7. spine: sp.Skeleton = null;
  8. @property(cc.Label)
  9. label2: cc.Label = null;
  10. show(iconId: number, skeletonData: sp.SkeletonData) {
  11. this.node.active = true;
  12. this.spine.skeletonData = skeletonData;
  13. this.spine.setAnimation(0, "win_idle", true);
  14. this.label2.string = MouseConst.ICON_MUTIPLE[iconId - 1].toString();
  15. }
  16. onClick() {
  17. this.node.parent.getComponent(MouseIconDetail).resetView();
  18. }
  19. }