难度UI
This commit is contained in:
@@ -35,7 +35,7 @@ export class StorageManager {
|
||||
this.stageMap.set(stageID, dataStage)
|
||||
}
|
||||
else {
|
||||
dataStage = createDataStage(config.DIFFICULTY_TYPE.Easy)
|
||||
dataStage = createDataStage("first", "", config.DIFFICULTY_TYPE.Easy)
|
||||
this.stageMap.set(stageID, dataStage)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ export interface DataUndo {
|
||||
|
||||
//关卡数据
|
||||
export interface DataStage {
|
||||
id: string,
|
||||
name: string,
|
||||
difficulty: number,
|
||||
mistake?: number,
|
||||
duration?: number,
|
||||
@@ -26,8 +28,8 @@ export interface DataStage {
|
||||
blocks?: Array<DataBlock>,
|
||||
undos?: Array<DataUndo>,
|
||||
}
|
||||
export function createDataStage(difficulty: number): DataStage {
|
||||
var data: DataStage = {difficulty: difficulty}
|
||||
export function createDataStage(id: string, name: string, difficulty: number): DataStage {
|
||||
var data: DataStage = {id: id, name: name, difficulty: difficulty}
|
||||
data.mistake = 0
|
||||
data.duration = 0
|
||||
data.note_open = false
|
||||
|
||||
35
src/views/Difficulty.ts
Normal file
35
src/views/Difficulty.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
const { regClass, property } = Laya;
|
||||
|
||||
@regClass()
|
||||
export class Difficulty extends Laya.Script {
|
||||
declare owner : Laya.Box;
|
||||
|
||||
|
||||
@property(Laya.Box)
|
||||
public obj_items: Laya.Box;
|
||||
private items: Array<Laya.Box> = new Array()
|
||||
|
||||
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
//onAwake(): void {}
|
||||
|
||||
//组件被启用后执行,例如节点被添加到舞台后
|
||||
//onEnable(): void {}
|
||||
|
||||
//组件被禁用时执行,例如从节点从舞台移除后
|
||||
//onDisable(): void {}
|
||||
|
||||
//第一次执行update之前执行,只会执行一次
|
||||
//onStart(): void {}
|
||||
|
||||
//手动调用节点销毁时执行
|
||||
//onDestroy(): void {}
|
||||
|
||||
//每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法
|
||||
//onUpdate(): void {}
|
||||
|
||||
//每帧更新时执行,在update之后执行,尽量不要在这里写大循环逻辑或者使用getComponent方法
|
||||
//onLateUpdate(): void {}
|
||||
|
||||
//鼠标点击后执行。与交互相关的还有onMouseDown等十多个函数,具体请参阅文档。
|
||||
//onMouseClick(): void {}
|
||||
}
|
||||
3
src/views/Difficulty.ts.meta
Normal file
3
src/views/Difficulty.ts.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"uuid": "87bad4d3-bede-442e-914d-d7bcdc85f0d1"
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { Block } from "./Block";
|
||||
import { Candy } from "./Candy";
|
||||
import { DOStage } from "../models/DOStage";
|
||||
import { config } from "../constants/config";
|
||||
import { DataUndo } from "../types/global";
|
||||
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user