• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 4 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0020 秒)

1. 组件脚本的内置方法 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...x, owner.y);//设置爆炸动画的位置,让其跟随方块 owner.removeSelf();//删除方块自身节点对象 Laya.SoundManager.playSound("resources/sound/destroy.wav"); } } PhysicsGameMainRT.instance.addScore(1); } else if (other.label === "ground") { //只要有一个盒子碰到地板,则...

来源: Laya3.0_文档 发布时间: 20251010

2. 实体组件系统 · LayaAir3.3 · 引擎文档 · LAYABOX [ 97%]

...igidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: any, contact: any): void { //如果被碰到,则移除子弹 this.owner.removeSelf(); } onUpdate(): void { //如果子弹超出屏幕,则移除子弹 if ((this.owner as Laya.Sprite).y < -10) { this.owner.removeSe...

来源: Laya3.0_文档 发布时间: 20251010

3. 多线程Worker · LayaAir3.3 · 引擎文档 · LAYABOX [ 95%]

...ker. 新建一个my_task.js文件,放到js文件夹下,代码如下: self.addEventListener('message', function (e) { var xmlreq = new XMLHttpRequest(); xmlreq.responseType = "text"; xmlreq.onload = function (e) { var data = e.currentTarget.response; self.postMessage(data); } xmlreq.open("get",...

来源: Laya3.0_文档 发布时间: 20251010

4. 二次开发 · LayaAir3.3 · 引擎文档 · LAYABOX [ 51%]

...8StringEncoding]; [[conchRuntime GetIOSConchRuntime] callbackToJSWithClass:self.class methodName:@"testAsyncCallback:" ret:jsonStr]; }); } 注意: (1)函数参数只支持布尔、浮点、字符串等基本类型,支持返回值。原生函数运行在脚本线程,更新UI需要转到UI...

来源: Laya3.0_文档 发布时间: 20250422