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