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

大约有 7 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0042 秒)

1. 实体组件系统 · LayaAir3.0文档 · LAYABOX [ 100%]

...代码中的使用如下: //鼠标按下时执行 onMouseDown(evt: Laya.Event): void { } //鼠标抬起时执行 onMouseUp(evt: Laya.Event): void { } //鼠标右键或中键按下时执行 onRightMouseDown(evt: Laya.Event): void { } //鼠标右键或中键抬起时执行 onRightMouseUp(evt: Laya.E...

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

2. 预制体模块 · LayaAir3.0文档 · LAYABOX [ 90%]

...en("./Scenes/Index.ls"); }); }); // 侦听加载失败 Laya.loader.on(Laya.Event.ERROR, this, this.onError); }); } /** * 当报错时打印错误 * @param err 报错信息 */ onError(err: string): void { console.log("加载失败: " + err); } /** * 加载时侦听 */ onLoading(progress: number): voi...

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

3. 2.x引擎项目升级指南 · LayaAir3.0文档 · LAYABOX [ 89%]

...Laya.Script命名函数方式处理输入。例如: this.aNode.on(Laya.Event.CLICK, ()=> { console.log("clicked"); }); class MyScript extends Laya.Script { //脚本事件 onMouseClick(e:Event) { console.log("clicked"); } } aNode.addComponent(MyScript); 以上两种方式是等价的,且在纯...

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

4. 动画状态机详解 · LayaAir3.0文档 · LAYABOX [ 83%]

...prite3D; private animator : Laya.Animator; onStart() { this.label.on( Laya.Event.CLICK, this, this.test ); //获得状态机 this.animator = this.target.getComponent<Laya.Animator>(Laya.Animator); } //运行状态机的跑动画,可使用动作融合方式 test(e: Laya.Event) { //动画状...

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

5. 时间轴动画编辑详解 · LayaAir3.0文档 · LAYABOX [ 76%]

...侧属性面板中设置动画事件属性,如图9-1所示 (图9-1) Event Name:在脚本中调用的事件方法名 Params:在脚本中调用事件方式时的传参(字符串),可以设置多个 如图9-2所示,例如对此事件添加一个 “event1” 方法名,添加两个...

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

6. 使用3DUI · LayaAir3.0文档 · LAYABOX [ 59%]

...void { this.bar.value = 1; this.value.visible = false; Laya.stage.on( Laya.Event.CLICK, this, this.onHurt ); } onHurt(): void { this.bar.value = this.bar.value - 0.1; this.value.y = 35; this.value.visible = true; Main.instance.animator.play("Stun"); Laya.Tween.to( this.value, { y : -20 }, 500, null,...

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

7. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 52%]

...ions", inspector: "Buttons", options : { buttons : [ { caption : "点我", event: "my_click" } ] } } ] } ]); this._panel.allowUndo = true; //根据需要设置 //如果不需要undo功能,也可以直接this._data = {}; this._data = IEditor.DataWatcher.watch({}); //inspect可以多次调用,将...

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