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,8 @@ import { Label } from 'cc';
|
||||
import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager';
|
||||
import { app, TD } from '../../App';
|
||||
import { GUI } from '../UIConfig';
|
||||
import { PlayerResourceShow } from '../Consts/Resource/PlayerResourceShow';
|
||||
import ResourceData from '../../data/ResourceData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('DungeonShowItem')
|
||||
@@ -14,8 +16,14 @@ export class DungeonShowItem extends JNScrollViewItem<TB.TbGSysDungeon> {
|
||||
@property(Label)
|
||||
title:Label;
|
||||
|
||||
//资源
|
||||
@property(PlayerResourceShow)
|
||||
resource:PlayerResourceShow;
|
||||
|
||||
onInit(){
|
||||
|
||||
this.resource.type = this.data.consume.id;
|
||||
this.resource.onUpdateView();
|
||||
this.onUpdateView();
|
||||
|
||||
}
|
||||
@@ -29,8 +37,17 @@ export class DungeonShowItem extends JNScrollViewItem<TB.TbGSysDungeon> {
|
||||
//点击副本
|
||||
onClickDungeon(){
|
||||
|
||||
GBattleModeManager.getIns().Open(BattleMode[`${this.data.type}`],true,TD[`${this.data.tigs}`].getDataList()[0].data);
|
||||
app.layer.Close(GUI.DungeonView);
|
||||
if(ResourceData.getIns().getValue(this.data.consume.id) >= this.data.consume.value){
|
||||
//打开副本
|
||||
GBattleModeManager.getIns().Open(BattleMode[`${this.data.type}`],true,{
|
||||
dungeonId:this.data.id,
|
||||
dungeonItemId:TD[`${this.data.tigs}`].getDataList()[0].id,
|
||||
data:TD[`${this.data.tigs}`].getDataList()[0].data
|
||||
});
|
||||
app.layer.Close(GUI.DungeonView);
|
||||
}else{
|
||||
app.layer.Open(GUI.Tips,{text:"没有钥匙了.."});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user