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

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

71. 场景管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 55%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Prefab }) private loadingScenePrefab: Laya.Prefab; private loadingScene: Laya.Node; constructor() { super(); } /** * 第一次执行update之前执行,只会执行一次 */ onSt...

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

72. LayaAir 2.0.1 切换场景报异常 Cannot read property ‘_physicsUpdateList’ [ 54%]

...erShape=null;         this._simulation=null;         (this.owner).transform.off(/*laya.events.Event.TRANSFORM_CHANGED*/"transformchanged",this,this._onTransformChanged);     } 2019-03-18 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与...

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

73. 实体组件系统 · LayaAir3.3 · 引擎文档 · 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_文档 发布时间: 20250103

74. 抖音小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 54%]

... } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake()...

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

75. 水平滚动条组件 · LayaAir3.3 · 引擎文档 · 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_文档 发布时间: 20240910

76. 垂直滚动条组件 · LayaAir3.3 · 引擎文档 · 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_文档 发布时间: 20240910

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

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

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

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

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

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

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

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

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

80. 设置后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