mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交开宝箱
This commit is contained in:
@@ -10,6 +10,8 @@ import { Label } from 'cc';
|
||||
import TimeUtil from '../../../../../extensions/ngame/assets/ngame/util/TimeUtil';
|
||||
import { ResourceType } from '../../../data/ResourceData';
|
||||
import JComponent from '../../../../../extensions/ngame/assets/ngame/util/components/JComponent';
|
||||
import { Button } from 'cc';
|
||||
import { EventTouch } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -102,6 +104,20 @@ export class MainForgingBench extends JComponent {
|
||||
await PetEquipData.getIns().upForgingBench();
|
||||
}
|
||||
|
||||
//打开指定装备
|
||||
onClickEquip(event: EventTouch){
|
||||
|
||||
let equip = PetEquipData.getIns().getPetEquip(event.target.getSiblingIndex() + 1);
|
||||
|
||||
if(!equip){
|
||||
app.layer.Open(GUI.Tips,{text:"快锻造装备吧~"});
|
||||
return;
|
||||
}
|
||||
|
||||
app.layer.Open(GUI.PetEquipForgingPopupView,equip)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
9
JisolGameCocos/assets/script/ui/Home/Item.meta
Normal file
9
JisolGameCocos/assets/script/ui/Home/Item.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "4c58e5a6-9a16-484d-b204-7423597c851b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
49
JisolGameCocos/assets/script/ui/Home/Item/MainPlayerInfo.ts
Normal file
49
JisolGameCocos/assets/script/ui/Home/Item/MainPlayerInfo.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Label } from 'cc';
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import PlayerData from '../../../data/PlayerData';
|
||||
import GBattleData, { GBattleDataEnum } from '../../../data/GBattleData';
|
||||
import { app } from '../../../App';
|
||||
import { tween } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainPlayerInfo')
|
||||
export class MainPlayerInfo extends Component {
|
||||
|
||||
//玩家名称
|
||||
@property(Label)
|
||||
playerNameLabel:Label;
|
||||
|
||||
//玩家战力
|
||||
@property(Label)
|
||||
playerFC:Label;
|
||||
|
||||
_FC:number = 0;
|
||||
get FC(){
|
||||
return this._FC
|
||||
}
|
||||
set FC(value:number){
|
||||
this._FC = value;
|
||||
this.playerFC.string = `${Math.floor(value)}`;
|
||||
}
|
||||
|
||||
protected onLoad(): void {
|
||||
this.onUpdateView();
|
||||
app.event.on(GBattleDataEnum.UPDARE_ATTRIBUTE_SUCCESS,this.onUpdateView,this);
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
app.event.off(GBattleDataEnum.UPDARE_ATTRIBUTE_SUCCESS,this.onUpdateView,this);
|
||||
}
|
||||
|
||||
onUpdateView() {
|
||||
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerName}`;
|
||||
|
||||
//过度
|
||||
tween(this.getComponent(MainPlayerInfo))
|
||||
.to(.5,{FC:GBattleData.getIns().data.getAllFC()})
|
||||
.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "fea8eb51-1d9e-4683-a678-05e498a071a8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -16,9 +16,6 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('MainView')
|
||||
export class MainView extends JNGLayerBase {
|
||||
|
||||
@property(Label)
|
||||
playerNameLabel:Label; //玩家名称
|
||||
|
||||
@property(Label)
|
||||
onHookLabel:Label; //挂机文本
|
||||
|
||||
@@ -60,7 +57,6 @@ export class MainView extends JNGLayerBase {
|
||||
|
||||
//更新UI界面
|
||||
onUpdateView(){
|
||||
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerName}`;
|
||||
this.onUpdateOnHookInfo();
|
||||
this.onUpdateOnHook();
|
||||
}
|
||||
|
Reference in New Issue
Block a user