game pause

This commit is contained in:
2025-05-22 19:12:00 +08:00
parent 4df55f9031
commit 4626e98717
30 changed files with 439 additions and 70 deletions

View File

@@ -0,0 +1,19 @@
const { regClass, property } = Laya;
@regClass()
export class AutoDestroy extends Laya.Script {
declare owner : Laya.Box;
@property(Number)
public lifeTime: number = 1;
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void {
if (this.lifeTime < 1) {
this.lifeTime = 1
}
Laya.timer.once(this.lifeTime*1000, this, ()=>{
this.owner.destroy()
})
}
}

View File

@@ -0,0 +1,3 @@
{
"uuid": "bdb0e671-99fa-47a5-9101-7ec008b1d25d"
}

View File

@@ -0,0 +1,13 @@
const { regClass, property } = Laya;
@regClass()
export class CommonData extends Laya.Script {
declare owner : Laya.Box;
@property(Number)
public intValue: number = 0;
@property(String)
public strValue: string = "";
}

View File

@@ -0,0 +1,3 @@
{
"uuid": "8857686b-9b2c-4e9c-af0f-0164c0994e46"
}

View File

@@ -0,0 +1,10 @@
import { respath } from "../../constants/respath"
export function G_ShowScoreTips(text: string, parent: any): void {
Laya.loader.load(respath.score_add_ui_res).then((go)=>{
var prefab = go.create()
var obj = parent.addChild(prefab)
var Label = obj.getChildByName("offset").getChildByName("Label") as Laya.Label
Label.text = text
})
}

View File

@@ -0,0 +1,3 @@
{
"uuid": "0a00337c-1c20-470f-930f-2b47f0294e23"
}