12345678910111213141516171819202122232425262728293031323334353637 |
- var HeadIcon = require("HeadIcon")
- cc.Class({
- extends: cc.Component,
- properties: {
- headIcon: {
- default: null,
- type: HeadIcon,
- serializable: true,
- },
- imageAdd: {
- default: null,
- type: cc.Sprite,
- serializable: true,
- },
- },
-
- resetData(data) {
- this.data = data;
- this.refreshView();
- },
-
- refreshView(){
- this.imageAdd.node.active = this.data == null;
- this.headIcon.node.active = this.data != null;
- if (this.data == null) {
- return;
- }
- this.headIcon.setPlayerInfo(this.data.playerInfo);
- },
- onClickHead() {
- },
- });
|