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

大约有 127 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0038 秒)

11. 组件脚本的内置方法 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

... void { this._level = Math.round(Math.random() * 5) + 1; this._text = this.owner.getChildByName("levelTxt") as Laya.Text; this._text.text = this._level + ""; } //每帧更新时执行 onUpdate(): void { //让持续盒子旋转 (this.owner as Laya.Sprite).rotation++; } //开始碰撞时执行 onTrigg...

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

12. Camera.viewportToRay中origin与direction相等问题 [ 74%]

...ce.mainCamera.viewportPointToRay(this._rayPt, this._ray); let scene = this.owner.scene as Laya.Scene3D; scene.physicsSimulation.rayCast(this._ray, this._raycastHit); console.log(this._raycastHit.succeeded); if(this._raycastHit.succeeded) console.log(this._raycastHit.collider.owner.name); } GameManag...

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

13. 字体切片组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 73%]

...虎兔龙蛇马羊猴鸡狗猪年快乐"; testFontClip.spaceY = 10; this.owner.addChild(clipnum); this.owner.addChild(fontClip); this.owner.addChild(testFontClip); this.owner.addChild(testClipNum); this.owner.addChild(clipnum1); } } 通常FontClip已经可以满足开发者的基本需求。如果...

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

14. Laya3.0 图片拼合缩放会导致两张图片之间有一条横线[已解决] [ 72%]

...ZONE 微信 biubiubiu 赞同来自: 以下是测试代码         this.owner.scene.scale(1.25, 1.25) //使用缩放后 图片拼合会多一条线 2.0中没有此问题         Laya.loader.load("http://103.219.177.59:63344/%2 ... ot%3B, Laya.Loader.TEXTURE2D).then((texture: Laya.Texture2D) =...

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

15. UI运行时 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

... RuntimeScript; onStart() { // 获得场景的Runtime对象 this.ui = this.owner.scene as RuntimeScript; // Button添加鼠标事件,让Image不显示 this.ui.Button.on( Laya.Event.MOUSE_DOWN, null, ()=>{ this.ui.Image.visible = false; }); } } ui 属性直接从脚本中通过 this.owner.scene ...

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

16. 射线检测报错,outHitInfo.sprite3D=null; [ 71%]

...D; private camera : Laya.Camera; private scene: Laya.Scene;  public _load(owner : any):void{ this.scene = owner; this.camera = this.scene.scene.getChildByName("Main Camera") as Laya.Camera; console.log("当前摄像机的名字是:" + this.camera.name); }  public _start(state:Laya.RenderState):v...

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

17. 音频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 70%]

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

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

18. 2.0版本可用的CameraMoveScript.ts [ 70%]

.../ onAwake(): void {         this.camera = (<Laya.Camera>this.owner);     }          /**          * @inheritDoc          */         /*override*/ onUpdate(): void {         var elapsedTime: number = Laya.timer.delta;         if (!isNaN...

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

19. 向stage下的scene里添加物体时报错 [ 70%]

...QZONE 微信 时光123 赞同来自: 使用Laya.stage.addchild. 或。this.owner.addChild 一样的错 2022-08-09 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 该问题目前已经被锁定, 无法添加新回复 发起人 时光123 相关问题 缓动Tween能用在3D物...

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

20. 事件管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 69%]

...如下代码: onAwake(): void { //侦听自定义的事件"Click" this.owner.on("Click",this,()=>{ console.log("侦听到自定义的“Click”事件"); }) } //鼠标点击后执行,发送Click事件。 onMouseClick(evt: Laya.Event): void { //自定义的事件 this.owner.event("Click"); } ...

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