提交开宝箱

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-11 02:46:36 +08:00
parent d0d80bb9ad
commit 05777799a3
51 changed files with 7665 additions and 2502 deletions

View 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();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "fea8eb51-1d9e-4683-a678-05e498a071a8",
"files": [],
"subMetas": {},
"userData": {}
}