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

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

1. UI运行时 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...击操作,IDE会弹窗提示创建UI组件脚本文件,默认是RuntimeScript.ts,开发者可以对其进行重命名,最后点击保存即可创建脚本。 (动图2-1) 可以看到,创建以后,除了生成RuntimeScript.ts之外,在项目工程中看到还多了一个 RuntimeScri...

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

2. 资源加载 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...Class, property } = Laya; @regClass() export class LoaderDemo extends Laya.Script { onAwake(): void { this.loadTexture("resources/image/monkey2.png", 500);//需要在resources/image放入相应的资源 this.loadTexture("https://layaair.com/3.x/demo/resources/res/apes/monkey2.png"); } /**加载并...

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

3. 组件装饰器说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加, 添加组...

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

4. 2D拖尾渲染器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 76%]

...** * 在节点上添加2D拖尾渲染器的示例代码 */ export class NewScript extends Laya.Script { declare owner: Laya.Sprite; private _trail2D: Laya.Trail2DRender; //从场景文件中获取到的宽度曲线数据 private _widthCurve: any[]; //从场景文件中获取到的颜色渐变数据 ...

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

5. 3D物理系统 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

...动进入触发器的生命周期。 2.4.4 使用生命周期方法 创建Script3D脚本 生命周期的方法,只能在脚本类里使用,所以,我们需要创建一个脚本,3D游戏必须要继承3D的脚本Script3D。空脚本的示例代码如下: /** * TypeScript语言的3D脚本示...

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

6. 时间轴动画 · LayaAir3.3 · 引擎文档 · LAYABOX [ 60%]

...码如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; constructor() { super(); } event1(p1:any, p2:any): void { console.log("event1",p1,p2); } } 在脚本中创建event1的方法和接收两个参数,最后我们来...

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

7. 使用3D摄像机 · LayaAir3.3 · 引擎文档 · LAYABOX [ 57%]

...rty } = Laya; @regClass() export default class CameraControll extends Laya.Script { @property( { type: Laya.Sprite3D } ) public target: Laya.Sprite3D; private camera: Laya.Camera; public distanceUp: number = 0.5;//相机与目标的竖直高度参数 public distanceAway: number = 10;//相机与目...

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

8. 2D寻路 · LayaAir3.3 · 引擎文档 · LAYABOX [ 52%]

...Class, property } = Laya; @regClass() export class TestSprite extends Laya.Script { // 用于显示鼠标点击的位置 @property({ type: Laya.Sprite }) public hit: Sprite; private _temp: Sprite; private _allAgent: Nav2DAgent[] = []; private findCompents(lists: any[], sprite: Sprite, componentType:...

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