mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -6,6 +6,7 @@ import { v3 } from 'cc';
|
||||
import { PlayerPetOV } from '../../../consts/API';
|
||||
import { Label } from 'cc';
|
||||
import { PlayerPetEvent } from '../../../data/PlayerPetData';
|
||||
import PetEquipData from '../../../data/PetEquipData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetIcon')
|
||||
@@ -17,6 +18,10 @@ export class PetIcon extends Component {
|
||||
@property(Node)
|
||||
starNode:Node; //星星
|
||||
|
||||
@property(Label)
|
||||
levelLabel:Label; //等级
|
||||
|
||||
|
||||
info:PlayerPetOV;
|
||||
|
||||
onLoad(){
|
||||
@@ -53,6 +58,9 @@ export class PetIcon extends Component {
|
||||
this.starNode.active = true;
|
||||
this.starNode.getComponentInChildren(Label).string = `${this.info.petStar}`;
|
||||
}
|
||||
|
||||
//设置宠物等级
|
||||
this.levelLabel.string = `Lv ${PetEquipData.getIns().getForgingBenchPetLevel(this.info.petId)}`
|
||||
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ import { PetEquip } from '../../../../consts/API';
|
||||
import { Sprite } from 'cc';
|
||||
import TbResource, { IconTypeEnum } from '../../../../tools/TbResource';
|
||||
import { TD } from '../../../../App';
|
||||
import { Label } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetEquipIcon')
|
||||
@@ -15,6 +16,9 @@ export class PetEquipIcon extends Component {
|
||||
@property(Node)
|
||||
notEquip:Node;
|
||||
|
||||
@property(Label)
|
||||
levelLabel:Label; //等级
|
||||
|
||||
info:PetEquip;
|
||||
|
||||
onLoad(){
|
||||
@@ -24,6 +28,7 @@ export class PetEquipIcon extends Component {
|
||||
//刷新页面
|
||||
onUpdateView(){
|
||||
|
||||
this.levelLabel.node.active = false;
|
||||
this.notEquip.active = true;
|
||||
if(!this.info) return;
|
||||
|
||||
@@ -32,6 +37,9 @@ export class PetEquipIcon extends Component {
|
||||
let config = TD.TbGRoleEquip.get(this.info.equipCfgId);
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.宠物装备,config.icon,this.sprite,this);
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.品质,config.quality,this.quality,this);
|
||||
|
||||
this.levelLabel.node.active = true;
|
||||
this.levelLabel.string = `Lv ${this.info.equipLevel}`;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user