mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import GOnHookData from '../../../data/GOnHookData';
|
||||
import { TD } from '../../../App';
|
||||
import GOnHookData, { GOnHookDataEnum } from '../../../data/GOnHookData';
|
||||
import { app, TD } from '../../../App';
|
||||
import { Label } from 'cc';
|
||||
import { TbGEntity } from '../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -9,9 +9,20 @@ const { ccclass, property } = _decorator;
|
||||
export class GameDifficultyTitle extends Component {
|
||||
|
||||
@property(Label)
|
||||
title:Label;
|
||||
title:Label; //标题
|
||||
@property(Node)
|
||||
progress:Node; //进度
|
||||
|
||||
protected update(dt: number): void {
|
||||
onLoad(){
|
||||
app.event.on(GOnHookDataEnum.UPDATE,this.onUpdateView,this);
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
app.event.off(GOnHookDataEnum.UPDATE,this.onUpdateView,this);
|
||||
}
|
||||
|
||||
onUpdateView(): void {
|
||||
|
||||
let info = GOnHookData.getIns().info;
|
||||
let sign = null;
|
||||
@@ -25,6 +36,12 @@ export class GameDifficultyTitle extends Component {
|
||||
|
||||
//显示难度
|
||||
this.title.string = `难度 : ${table.data.level}-${table.data.childLevel}`;
|
||||
//显示进度
|
||||
this.progress.children.forEach((item,index) => {
|
||||
if(index < GOnHookData.getIns().getProgress())
|
||||
item.active = true;
|
||||
else item.active = false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user