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

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

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

...; } onEnable(): void { //设置初始速度 let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: any, contact: any): void { //如果被碰到,则移除子弹 this.owner.removeSelf(); } onUpdate(): void { //如果...

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

72. 水平滚动条组件 · LayaAir3.0文档 · LAYABOX [ 53%]

...建文本组件 this.text = new Laya.Text(); this.text.pos(300, 260); this.owner.addChild(this.text); // 滚动条皮肤资源 var skins: any[] = []; skins.push("atlas/comp/hscroll.png", "atlas/comp/hscroll$bar.png", "atlas/comp/hscroll$down.png", "atlas/comp/hscroll$up.png"); Laya.loader.load(skins...

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

73. 垂直滚动条组件 · LayaAir3.0文档 · LAYABOX [ 53%]

...建文本组件 this.text = new Laya.Text(); this.text.pos(300, 260); this.owner.addChild(this.text); // 滚动条皮肤资源 var skins: any[] = []; skins.push("atlas/comp/vscroll.png", "atlas/comp/vscroll$bar.png", "atlas/comp/vscroll$down.png", "atlas/comp/vscroll$up.png"); Laya.loader.load(skins...

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

74. addComponent后成功加载了自定义Script,但是无法执行到script的onEnable,onUpdate等方法 [ 53%]

...少帧自动销毁的Script,只是在onUpdate里面记个时然后调用owner的destory方法,在new出来的Sprite里添加脚本时脚本被创建成功了,但是sprite被添加到场景后却没有走到脚本里的onActive等方法里面,断点看我写的组件脚本在我的sprite里...

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

75. 预设组件挂脚本,添加到场景以后赋值失败 [ 53%]

...件赋值,其它组件的引用全是不对的   但是如果通过this.owner.getChildByName("testLb") 这种方式,就是正常的,这能优化下??????   附件 : --> demo5.zip 2021-10-26 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: ...

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

76. rigidBody.applyForce 物体不会移动 [ 52%]

...到的物体 this.text.text = "点击到了" + this._outHitResult.collider.owner.name; } } } 2020-09-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 0 个回复 为什么被折叠? 0 个回复被折叠 要回复问题请先...

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

77. 设置后box2d 的 worldRoot 后平移场景 物理世界原地不动 [ 51%]

...能吗,这样可以 onAwake() { const self = this; self.gameObj = self.owner as Laya.Sprite; Laya.Physics.I.worldRoot = self.gameObj; this.cameraRect = new Laya.Rectangle(0, 0, 2000, 1000); this.gameObj.scrollRect = this.cameraRect; } onUpdate() { this.cameraRect.x = this.target.x - 400; this.came...

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

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

.../Script1.ts @regClass() export class Script1 extends Laya.Script { declare owner : Laya.Sprite3D; } //TestCustomEditor.ts @IEditorEnv.customEditor(Script1) export class TestCustomEditor extends IEditorEnv.CustomEditor { declare owner: Laya.Sprite3D; onSceneGUI(): void { IEditorEnv.Handles.drawHemiSp...

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

79. 基础文本 · LayaAir3.0文档 · LAYABOX [ 51%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Text }) txt: Laya.Text; constructor() { super(); } onAwake(): void { this.txt.text = "第{n=1}页"; //显示文本的初始化内容 } onStart(): void { let page: number = 1; Laya...

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

80. 内置骨骼动画 · LayaAir3.0文档 · LAYABOX [ 50%]

...ture.x = 300; this.mArmature.y = 350; this.mArmature.scale(0.5, 0.5); this.owner.addChild(this.mArmature); //设置动画播放完成后,调用completeHandler继续播放下一个动画 this.mArmature.on(Laya.Event.STOPPED, this, this.completeHandler); this.play(); }); } private completeHandler():...

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