大约有 148 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0042 秒)
...可。以给Image组件添加皮肤为例,示例代码如下: const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onAwake(): void { let img = new Laya.Image; Laya.stage.addChild(img); img.pos(500,100); img.skin = "resources/layabox.png"; //纹理压缩的图...
来源: Laya3.0_文档 发布时间: 20251010
...点后,加入下述代码,实现一个光遮挡器的效果: const { regClass, property } = Laya; @regClass() export class LightOccluder extends Laya.Script { private spotLight: Laya.Sprite = new Laya.Sprite(); private background: Laya.Sprite = new Laya.Sprite(); private lightOccluder: Laya.Sp...
来源: Laya3.0_文档 发布时间: 20251010
...断是否某个动画状态是否播完,例如下面的代码: const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { @property( { type: Laya.Label } ) private label: Laya.Label; @property( { type: Laya.Sprite3D } ) private target: Laya.Sprite3D; private animato...
来源: Laya3.0_文档 发布时间: 20251010
...链接 提交 1 个回复 不问苍生 赞同来自: Laya.ClassUtils.regClass("ui.mainUI.Fly_ObjUI",ui.mainUI.Fly_ObjUI); 在使用动效之前,调用,具体做什么的暂时不知道,UI找不到类的错误使用 2018-12-14 0 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复...
来源: Laya_社区 发布时间: 20181214
...e2D下添加一个自定义组件脚本,并添加如下代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Sprite }) public sprite1: Laya.Sprite; @property({ type: Laya.Sprite }) public spri...
来源: Laya3.0_文档 发布时间: 20251010
...同来自: if (!Laya.ClassUtils.getClass('Laya.Text')) { Laya.ClassUtils.regClass('Laya.Text', Laya.Text); } 2021-04-22 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 Fico 相关问题 laya2.0加载3d场景报错Uncaught TypeError: Canno...
来源: Laya_社区 发布时间: 20201125
...设置一个脚本,用于初始化和配置性能分析工具。 const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property(Number) public projectId: number = 23; private perfMain: LayaPerf = new LayaPerf(); onEnable(): void { this.perfMain.init(this.pr...
来源: Laya3.0_文档 发布时间: 20251010
... Laya.addAfterInitCallback(()=>{ console.log("after init"); }); const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { console.log("Game start"); } } 2.2 场景的脚本说明 前面讲了项目的入口, 本小节简述一下场景的脚本。场...
来源: Laya3.0_文档 发布时间: 20251216
...尾的各项属性。示例代码如下所示: 示例代码: const { regClass, property } = Laya; @regClass() /** * 在节点上添加2D拖尾渲染器的示例代码 */ export class NewScript extends Laya.Script { declare owner: Laya.Sprite; private _trail2D: Laya.Trail2DRender; //从场景文...
来源: Laya3.0_文档 发布时间: 20251010
...码找不到。 于是添加代码在文件42292行添加 Laya.ClassUtils.regClass("Rigidbody3D", Rigidbody3D); // add by ning at 2019-07-31 16:40 问题解决 附件 : --> 2019-07-31 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的...
来源: Laya_社区 发布时间: 20190731