JobItem.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const ArtistManager = require('../utils/ArtistManager');
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. role: sp.Skeleton,
  6. },
  7. onLoad() { },
  8. bind(jobInfo, gender) {
  9. // skinSkeleton.skeletonData =
  10. // this.nameLabel.string = '<outline color=#ffffff width=2><b>' + jobInfo.name + '</b></outline>';
  11. // this.summaryLabel.string = jobInfo.msg;
  12. // let picId = 50000 + jobInfo.id;
  13. // this.titleText.string = `<img src='${picId}' /> <outline color=#584A47 width=3><b>${jobInfo.name}</b></outline>`
  14. // cc.loader.loadRes(jobInfo.picId, cc.SpriteFrame, (error, spriteFrame) => {
  15. // this.iconSripte.spriteFrame = spriteFrame;
  16. // });
  17. //现在只有舞者有骨骼动画,默认jodId为2
  18. ArtistManager.loadArtist(true, gender, jobInfo.id)
  19. .then((skeletonData) => {
  20. this.role.skeletonData = skeletonData;
  21. this.role.animation = "stand";
  22. }).catch((err) => {
  23. console.log(err);
  24. });
  25. },
  26. start() {
  27. },
  28. // update (dt) {},
  29. });