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

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

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

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

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

2. 开放数据域组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 95%]

...,脚本内容如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): v...

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

3. 插件开发说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

...代码 //注意:IEditorEnv.regClass是必须的 @IEditorEnv.regClass() export class TestSceneScript { //注意:this是当前的IEditorEnv.IGameScene对象,如果需要,也可以省略这个声明 static test(this: IEditorEnv.IGameScene, msg: string) { console.log(msg); //hello return "ok"...

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

4. 抖音小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 70%]

...载代码示例如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已...

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

5. 支付宝小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 64%]

...载代码示例如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一...

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

6. TiledMap地图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 62%]

... 3.2.2 创建地图示例 const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { private tMap:Laya.TiledMap; onEnable() { //创建地图对象 this.tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Laya.Rectangle = new Laya.Rectangle(0,...

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

7. vivo小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 55%]

...载代码示例如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已...

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

8. 2.x引擎项目升级说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 54%]

... Laya; //有了@regClass(),才会被识别为script脚本类 @regClass() export class Script extends Laya.Script { //属性上面有了@property(),才会被识别为IDE里可暴露的属性,每一个属性只要需要暴露,上面就都需要加上@property()。 @property( { type : String } ...

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

9. 微信小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 53%]

...分包的示例代码: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已...

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