BattleRoomPlayerIcon.js 721 B

12345678910111213141516171819202122232425262728293031323334353637
  1. var HeadIcon = require("HeadIcon")
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. headIcon: {
  6. default: null,
  7. type: HeadIcon,
  8. serializable: true,
  9. },
  10. imageAdd: {
  11. default: null,
  12. type: cc.Sprite,
  13. serializable: true,
  14. },
  15. },
  16. resetData(data) {
  17. this.data = data;
  18. this.refreshView();
  19. },
  20. refreshView(){
  21. this.imageAdd.node.active = this.data == null;
  22. this.headIcon.node.active = this.data != null;
  23. if (this.data == null) {
  24. return;
  25. }
  26. this.headIcon.setPlayerInfo(this.data.playerInfo);
  27. },
  28. onClickHead() {
  29. },
  30. });