整理代码格式
This commit is contained in:
@@ -10,13 +10,13 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "eslint . --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"bezier-easing": "^2.1.0",
|
||||
"lottie-web": "^5.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^4.13.0",
|
||||
"eslint": "^9.26.0",
|
||||
"eslint-plugin-format": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"bezier-easing": "^2.1.0",
|
||||
"lottie-web": "^5.13.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,9 +70,8 @@ export class ResourceManager {
|
||||
console.log("预加载资源进度>>>>", resProg)
|
||||
}))
|
||||
|
||||
|
||||
Laya.timer.frameLoop(1, this, () => {
|
||||
let removes: Array<any> = []
|
||||
const removes: Array<any> = []
|
||||
this.prefabReqs.forEach((list: Array<any>, path: string) => {
|
||||
const obj = Laya.loader.getRes(path)
|
||||
if (obj) {
|
||||
@@ -157,5 +156,4 @@ export class ResourceManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,9 +11,8 @@ import { GameOver } from "../views/GameOver"
|
||||
import { GamePause } from "../views/GamePause"
|
||||
import { Stage } from "../views/Stage"
|
||||
import { TopBar } from "../views/TopBar"
|
||||
import { StorageManager } from "./StorageManager"
|
||||
import { ResourceManager } from "./ResourceManager"
|
||||
import Lottie from "lottie-web"
|
||||
import { StorageManager } from "./StorageManager"
|
||||
|
||||
const { regClass, property } = Laya
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ResourceManager } from "../models/ResourceManager"
|
||||
import { UIManager } from "../models/UIManager"
|
||||
import { Utility_EaseOut, Utility_EaseOut_2 } from "../utils/utility"
|
||||
|
||||
|
||||
const { regClass, property } = Laya
|
||||
|
||||
export function G_ShowCommonTips(title: string, content: string, showToggle: boolean, func: any): void {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { DOStage } from "../models/DOStage"
|
||||
import { config } from "../constants/config"
|
||||
import { respath } from "../constants/respath"
|
||||
import { ResourceManager } from "../models/ResourceManager"
|
||||
import { StorageManager } from "../models/StorageManager"
|
||||
import { UIManager } from "../models/UIManager"
|
||||
import { Utility_ConvertSecondToString } from "../utils/utility"
|
||||
import { Difficulty } from "./Difficulty"
|
||||
import { ResourceManager } from "../models/ResourceManager"
|
||||
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@@ -53,7 +53,6 @@ export class GameDone extends Laya.Script {
|
||||
public btn_continue: Laya.Box
|
||||
|
||||
onAwake(): void {
|
||||
|
||||
ResourceManager.getInstance().loadTexture(respath.bg_done, this.bg)
|
||||
|
||||
this.owner.x = 0
|
||||
|
||||
@@ -2,11 +2,11 @@ import type { DOStage } from "../models/DOStage"
|
||||
import { config } from "../constants/config"
|
||||
import { respath } from "../constants/respath"
|
||||
import { EVENT_TYPES, EventManager } from "../models/EventManager"
|
||||
import { ResourceManager } from "../models/ResourceManager"
|
||||
import { StorageManager } from "../models/StorageManager"
|
||||
import { UIManager } from "../models/UIManager"
|
||||
import { Difficulty } from "./Difficulty"
|
||||
import { ResourceManager } from "../models/ResourceManager"
|
||||
import { Utility_EaseOut, Utility_EaseOut_2 } from "../utils/utility"
|
||||
import { Difficulty } from "./Difficulty"
|
||||
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@@ -50,7 +50,6 @@ export class GameOver extends Laya.Script {
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
public onSetStageInfo(doStage: DOStage): void {
|
||||
this.btn_second.on(Laya.Event.CLICK, this, () => {
|
||||
doStage.set_mistake(doStage.get_mistake() - 1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Utility_EaseOut } from "../utils/utility";
|
||||
import BezierEasing from "bezier-easing"
|
||||
import { Utility_EaseOut } from "../utils/utility"
|
||||
import { AutoDestroy } from "./common/AutoDestroy"
|
||||
import BezierEasing from 'bezier-easing';
|
||||
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@@ -25,7 +25,6 @@ export class ScoreAdd extends Laya.Script {
|
||||
}
|
||||
|
||||
onStart(): void {
|
||||
|
||||
// const filter: Laya.GlowFilter = new Laya.GlowFilter("#000000", 5, 0, 0);
|
||||
// this.label.filters = [filter];
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ export class Stage extends Laya.Script {
|
||||
Stage._instance.onUpdatePaused(arg)
|
||||
}
|
||||
}
|
||||
|
||||
public onUpdatePaused(paused: boolean): void {
|
||||
this.paused = paused
|
||||
Stage._instance.obj_mask.visible = paused
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { ResourceManager } from "../../models/ResourceManager";
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@regClass()
|
||||
export class UISequenceAnimation extends Laya.Script {
|
||||
declare owner : Laya.Image;
|
||||
declare owner: Laya.Image
|
||||
|
||||
@property(String)
|
||||
public prefix: string;
|
||||
public prefix: string
|
||||
|
||||
@property(Number)
|
||||
public beginIndex: number = 0
|
||||
@@ -44,11 +42,11 @@ export class UISequenceAnimation extends Laya.Script {
|
||||
}
|
||||
let endStr = this.currentIndex.toString()
|
||||
if (this.currentIndex < 10) {
|
||||
endStr = "00" + this.currentIndex
|
||||
endStr = `00${this.currentIndex}`
|
||||
} else if (this.currentIndex < 100) {
|
||||
endStr = "0" + this.currentIndex
|
||||
endStr = `0${this.currentIndex}`
|
||||
}
|
||||
let path = this.prefix + endStr + '.png'
|
||||
const path = `${this.prefix + endStr}.png`
|
||||
// ResourceManager.getInstance().loadTexture(path, this.image)
|
||||
this.owner.skin = path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user