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

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

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

... 下面是一个推荐做法: //Script.ts @Laya.regClass() class Script extends Laya.Script { wantToUseNode() { EditorEnv.scene.runScript("TestSceneScript.visitNode"); } } //TestSceneScript.ts import fs from "fs"; //注意是IEditorEnv.regClass,不是Laya.regClass!! @IEditorEnv.regClass() class ...

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

12. Laya.Script的派生类的_update函数不工作? [ 82%]

Laya.Script的派生类的_update函数不工作? 我从Laya.Scriptextends了一个自己的class,贴在一个物体上,运行的时候脚本的_start函数中的log正常打印出来了,但是_update函数中的log没有打印 _update(state:Laya.RenderState) { console.log("state:", st...

来源: Laya_社区 发布时间: 20180614

13. 新手入坑请教下各位大神关于LayaMaxUI问题 [ 81%]

...Laya.ClassUtils.regClass; export module ui.test { export class TestSceneUI extends Laya.Scene {         public scoreLbl:Laya.Label;         public tipLbll:Laya.Label; constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("test/TestScene"); } } REG("ui...

来源: Laya_社区 发布时间: 20190402

14. 继承Scene没有onEnable [ 80%]

...ene.root.addChild(t);     } } //激活启动类 new Main();  class tt extends Laya.Node{     constructor(){         super();     }     public onAwake():void{         console.log(1111);     } }   2.继承Sprite 执行后会有onAwake         let t = new ...

来源: Laya_社区 发布时间: 20190701

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

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

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

16. Laya.Script _start和_update以及_lateupdate不执行是什么原因呢? [ 80%]

... _start和_update以及_lateupdate不执行是什么原因呢?  class b extends Laya.Script{    _initialize(owner:Laya.Sprite3D){      super._initialize(owner);      //加打印可以执行    }        _start(state:Laya.RenderState):void{       //加打印不执行     } }   ...

来源: Laya_社区 发布时间: 20180423

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

...} from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUSE_DOWN, this, ()=>{ this.Image.visible = false; }); } } 其次,可以在Scene2D节点下添加...

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

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

... const { regClass, 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

19. 音频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 79%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕...

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

20. 请问 layaair2.0的js有没有api可以查询 例如Laya.Script [ 78%]

...法获知,我点的是哪个,代码 如下 export default class btn1 extends Laya.Script { constructor(){super();} onEnable(){} onClick(){ alert("id="+this.id); //这里有一个id,但是系统自动生成的,无法获知这个id代表哪个按钮被点(因为我有4个按钮都绑了这...

来源: Laya_社区 发布时间: 20181029