mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交锻造装备
This commit is contained in:
@@ -5,6 +5,7 @@ import { GUI } from '../../UIConfig';
|
||||
import { API, PlayerPetOV } from '../../../consts/API';
|
||||
import { PetIconSelectShow } from '../../Consts/Pet/PetIconSelectShow';
|
||||
import PlayerPetData from '../../../data/PlayerPetData';
|
||||
import { PetEquipIcon } from '../../Consts/PetEquip/icon/PetEquipIcon';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -16,25 +17,41 @@ export class MainForgingBench extends Component {
|
||||
@property(PetIconSelectShow)
|
||||
petView:PetIconSelectShow;
|
||||
|
||||
//装备列表
|
||||
@property(Node)
|
||||
equips:Node;
|
||||
|
||||
onLoad(){
|
||||
this.onUpdateView();
|
||||
|
||||
//监听锻造数据
|
||||
app.event.on(PetEquipDataEnum.UPDATE_FORGING_INFO,this.onUpdateForging,this);
|
||||
app.event.on(PetEquipDataEnum.UPDATE_EQUIP,this.onUpdateEquip,this);
|
||||
|
||||
this.onUpdateView();
|
||||
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
|
||||
app.event.off(PetEquipDataEnum.UPDATE_FORGING_INFO,this.onUpdateForging,this);
|
||||
app.event.off(PetEquipDataEnum.UPDATE_EQUIP,this.onUpdateEquip,this);
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
this.onUpdateForging();
|
||||
this.onUpdateEquip();
|
||||
}
|
||||
|
||||
//刷新装备
|
||||
onUpdateEquip(){
|
||||
this.equips.getComponentsInChildren(PetEquipIcon).forEach((equip,index) => {
|
||||
equip.set(PetEquipData.getIns().getPetEquip(index + 1));
|
||||
})
|
||||
}
|
||||
|
||||
//刷新锻造数据
|
||||
onUpdateForging(){
|
||||
console.log("刷新锻造数据",PlayerPetData.getIns().petIdQueryPetInfo(PetEquipData.getIns().info.forgingPetId));
|
||||
this.petView.set(PlayerPetData.getIns().petIdQueryPetInfo(PetEquipData.getIns().info.forgingPetId));
|
||||
}
|
||||
|
||||
|
@@ -110,6 +110,11 @@ export class MainView extends JNGLayerBase {
|
||||
app.layer.Open(GUI.Debugger);
|
||||
}
|
||||
|
||||
//打开宠物装备
|
||||
onClickPetEquip(){
|
||||
app.layer.Open(GUI.PetEquipView);
|
||||
}
|
||||
|
||||
//点击下一关
|
||||
async onClickNextLevel(){
|
||||
GOnHookManager.getIns().onNextLevel();
|
||||
|
Reference in New Issue
Block a user