大约有 12 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0044 秒)
...脚本,而后添加的代码如下所示: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUS...
来源: Laya3.0_文档 发布时间: 20251010
...ufDemo.ts // 引入生成的 protobuf 模块,路径相对于当前文件 import * as protobuf from "./libs/protobuf/protobuf"; const { regClass } = Laya; @regClass() export class ProtobufDemo extends Laya.Script { onEnable() { console.log("Game start"); } } 2.2 Protobuf示例脚本 引入了protob...
来源: Laya3.0_文档 发布时间: 20251010
...的提高程序的运行速度和稳定性。 5.1 自定义Particle3D类 import Node = Laya.Node; import Sprite3D = Laya.Sprite3D; import ShuriKenParticle3D = Laya.ShuriKenParticle3D; import ShurikenParticleSystem = Laya.ShurikenParticleSystem; import { Pool } from "./Pool"; //粒子特效的基类...
来源: Laya3.0_文档 发布时间: 20251010
...的提高程序的运行速度和稳定性。 5.1 自定义Particle3D类 import Node = Laya.Node; import Sprite3D = Laya.Sprite3D; import ShuriKenParticle3D = Laya.ShuriKenParticle3D; import ShurikenParticleSystem = Laya.ShurikenParticleSystem; import { Pool } from "./Pool"; //粒子特效的基类...
来源: Laya3.0_文档 发布时间: 20250104
...rl预制体,添加到场景中,并用鼠标点击屏幕来切换动画 import { MainBase } from "./Main.generated"; import KeyBoardManager = Laya.InputManager; import Keyboard = Laya.Keyboard; const { regClass, property } = Laya; @regClass() export class Main extends MainBase { private _animator...
来源: Laya3.0_文档 发布时间: 20251010
...。 使用npm install xxx --save 安装xxx包。 然后在代码中使用import语句导入即可。 1.2 使用示例 我们用第三方AStar模块来讲解: 1.2.1 npm init 在开发中使用npm init会生成一个pakeage.json文件,这个文件主要是用来记录这个项目的详细信息的...
来源: Laya3.0_文档 发布时间: 20251010
...法的使用,示例代码如下: const { regClass, property } = Laya; import PhysicsGameMainRT from "../scence/physicsDemo/PhysicsGameMainRT"; /** * 掉落盒子脚本,实现盒子碰撞及回收流程 */ @regClass() export default class DropBox extends Laya.Script { /**盒子爆炸动画的...
来源: Laya3.0_文档 发布时间: 20251010
...本 "点击成功!",代码如下所示: const { regClass } = Laya; import { MsgRTBase } from "./MsgRT.generated"; @regClass() export class MsgRT extends MsgRTBase { onOpened(param: any): void { console.log(param.text); } } 这样,点击Scene场景中的Button,就会打印日志“点击成...
来源: Laya3.0_文档 发布时间: 20251010
...的LayaDCCTools的接口见源码。 4.8 根据文件列表生成pack包 import {layadcctools} from './dist/layadcctools.js' const {LayaDCCTools,LayaDCC,Params,PackRaw} = layadcctools; layadcctools.LayaDCCTools.genPackByFileList( [ 'D:/work/ideproj/DCCPlugin/release/web/internal/sky.jpg', ], 'd:/tem...
来源: Laya3.0_文档 发布时间: 20251010
...码中,可以看到,通过预加载一组预制体的实现代码: import { LoadingRTBase } from "./LoadingRT.generated"; const { regClass, property } = Laya; @regClass() export default class LoadingRT extends LoadingRTBase { onAwake(): void { Laya.loader.load( //先加载本场景要用的 ["...
来源: Laya3.0_文档 发布时间: 20241014