大约有 182 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0050 秒)
...再把CANNON.Body包装成组件 export class CannonRigidbody extends Laya.Script3D { static map: { [key: number]: Laya.Sprite3D } = {}; body: CANNON.Body; t: Laya.Transform3D; public onCollisionCB: (s: Laya.Sprite3D) => void; public ignoreRotate: boolean = false; ...OnAwake里面创建CANNON.Bod...
来源: Laya_社区 发布时间: 20200217
...们把左侧的菜单切换到代码模式。并在src目录中新建一个script文件夹,右键新建一个“新建模板文件”-》“新建脚本文件”。并编写如下代码。 [list=none] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/...
来源: Laya_社区 发布时间: 20190321
...取到觖发信息了 export default class PlayerController extends Laya.Script3D 2020-07-29 0 0 分享 微博 QZONE 微信 不懂就问 赞同来自: isKinematic=true,这个为true是没有碰撞检测的 2020-07-29 0 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 该问题...
来源: Laya_社区 发布时间: 20200728
...gClass, property } = Laya; @regClass() export class SpotLight extends Laya.Script { @property({ type: Laya.Sprite }) private spotLight: Laya.Sprite; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.setSpotLight(); } // 创建聚光灯 setSpotLight(): void { this...
来源: Laya3.0_文档 发布时间: 20251010
...lt; } 最后,在LayaExtInit函数中,导出初始化功能,使得JavaScript代码可以调用这些原生功能。 extern "C" { LAYAEXTAPI void LayaExtInit(jsvm_env env, jsvm_value exp) { ... // 注册Steam初始化函数 jsvm_value fnInitSteam; jsvm_create_function(env, "initializeSteam", SIZ...
来源: Laya3.0_文档 发布时间: 20251010
...时也不通过 代码: export default class Index extends Laya.Script { /* @prop {name: speed, tips: "速度", type: Number, default: 10} */ constructor() { super(); } onAwake() { console.log("场景渲染完...
来源: Laya_社区 发布时间: 20191227
... protobufjs-cli工具有pbjs和pbts这两个指令,分别用于生成JavaScript 库文件.js和TypeScript 声明文件.d.ts。由于指令参数较多,通常会配置在项目中,直接调用快捷指令即可。 示例代码如下: "scripts": { "pbjs": "pbjs -t static-module -w commonjs -o ...
来源: Laya3.0_文档 发布时间: 20251010
...08* [Cannon.js](https://github.com/schteppe/cannon.js) :完全使用 JavaScript 编写的优秀 3D 物理引擎,包含简单的碰撞检测、各种形状的摩擦力、弹力、约束等功能。在LayaAir 2.7.0beta中,完成了对其基本功能的支持,并逐步在后续的版本中完...
来源: Laya2.0_文档 发布时间: 20210714
...代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.ViewStack }) public viewstack: Laya.ViewStack; @property({ type: Laya.Tab }) public tab: Laya.Tab; //组件被激活后执行,此时所有节点和组件均已创建完毕...
来源: Laya3.0_文档 发布时间: 20251010
... { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { // 设置单例 static instance: Main; constructor() { super(); Main.instance = this; } @property({type:Laya.Sprite3D}) private target: Laya.Sprite3D; @property({type:Laya.UI3D}) private ui3d: Laya.UI3D; public anima...
来源: Laya3.0_文档 发布时间: 20251010