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

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

31. 射线检测报错,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

32. 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

33. (实现手指控制模型的缩放旋转)触控可以识别 但是导入的模型没有根据触控反应 [ 70%]

...rue;         this.twoFirst = true; } onStart(){ this._scene = this.owner.parent as Laya.Scene3D;         this._text = this._scene.parent.getChildByName("ceshi") as Laya.Text;         this._camera = this._scene.getChildByName("camera") as Laya.Camera; } onUpdate(){ var touchCo...

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

34. 摄像机的viewportPointToRay报错 [ 70%]

...a); PanelMgr.mainCamera.viewportPointToRay(this.pointRay, this.ray); (this.owner as Laya.Scene3D).physicsSimulation.rayCast(this.ray,this.hitresult); console.log(Laya.MouseManager.instance.mouseX + " -=----------" + Laya.MouseManager.instance.mouseY); if (this.hitresult.succeeded) { console.log(this...

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

35. 基础文本 · LayaAir3.3 · 引擎文档 · LAYABOX [ 70%]

...= 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_文档 发布时间: 20251010

36. Shader预编译解决方案 [ 69%]

...= Shader3D._debugShaderVariantInfo;     var debugSubShader = this._owner;     var debugShader = debugSubShader._owner;     var deugDefines = ShaderPass._debugDefineString;     //将defineDatas抓换成宏定义数组     Shader3D._getNamesByDefineData(compileDefine, de...

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

37. viewportPointToRay产生的射线始终有偏差,是为什么? [ 69%]

...tate); this._phasorSpriter3D = new PhasorSpriter3D(); this._camera = this._owner.getChildByName("Camera") as Camera; } public _postRenderUpdate(state:RenderState):void { super._update(state); this._point.elements[0] = Laya.stage.mouseX; this._point.elements[1] = Laya.stage.mouseY; this._camera.viewp...

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

38. 如何通过代码控制prefab上面的时间轴动画animation? [ 68%]

...作。 ... ani_show:Laya.FrameAnimation; onAwake(){ this.ani_show = this.owner["play"] as Laya.FrameAnimation; // 在onAwake中添加播放完成事件,基于某些原因,可能在onDisable的时候被移除,如果发现异常,可以选择在onEnable里面添加事件 this.ani_show.on(Laya.E...

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

39. Laya3D 中如何解决3D模型上添加文本的问题,类似Unity中的3DText [ 68%]

...Script{ public title: string; constructor(){ super(); } public _initialize(owner: Laya.Sprite3D): void { super._initialize(owner); var sprite3D = this.owner as Laya.MeshSprite3D; var sprite3DMat = new Laya.StandardMaterial(); sprite3DMat.cull = Laya.BaseMaterial.CULL_NONE; var imageData = this.canva...

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

40. [LayaAir3]LayaAir3.3使用Fairygui开发UI,滤镜效果对不上 [ 68%]

...nst view = pkgs[0].createObject("View"); console.log(view); this.owner.addChild(view.displayObject); }); } 我提出的問題是,Fairygui編輯器和Laya編輯器,使用BlendMode和濾鏡的效果不相同。 格局豬 - 趙唐豬豬 • 2025-09-08 12:29 我重新描述問題 需求: ...

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