大约有 37 项符合查询结果, 库内数据总量为 30,897 项。 (搜索耗时: 0.0038 秒)
... // 文本显示当前时间 onAwake(): void { this.lightComp = this.owner.getComponent(Laya.DirectionLight2D); // 初始化文本组件 this.displayText = new Laya.Text(); this.displayText.color = "#ffffff"; this.displayText.font = "Arial"; this.displayText.fontSize = 24; this.displayText.bold = tr...
来源: Laya3.0_文档 发布时间: 20250214
...long to other node."; if (comp.isSingleton && this.getComponent((comp).constructor)) throw "Node:the component is singleton,can't add the second one."; this._addComponentInstance(comp); return comp; } 暂时...
来源: Laya_社区 发布时间: 20190609
...0,0,100,0)确实不会报错,但如果是已存在,比如先设置sp.getComponent(ChainCollider).points = "25,25,50,50";运行后,再改变值时(如果一次运行中连续赋值2次,是不会报错的,必须执行再赋值),就会报错。 如下使用2d示例项目中代码,改写...
来源: Laya_社区 发布时间: 20181130
...是继承Laya.Dialog的,无法像Laya.scene那样加控制脚本,this.getComponent(xx),取不到控制类,何解?
来源: Laya_社区 发布时间: 20181211
...此方法只执行一次 onAwake(): void { this.light1Render = this.light1.getComponent(Laya.FreeformLight2D); this.mesh1Render = this.mesh1.getComponent(Laya.Mesh2DRender); this.mesh2Render = this.mesh2.getComponent(Laya.Mesh2DRender); //设置mesh1位于0层(Default层) this.mesh1Render.layer ...
来源: Laya3.0_文档 发布时间: 20250214
...ake(): void { // 获取 FreeformLight2D 组件 this.lightComp = this.owner.getComponent(Laya.FreeformLight2D); //灯光的顶点通常建议是在IDE中可视化配置,这里是为了演示如何通过代码动态设置顶点数据,方便动态调整灯光形状的需求。 /**设置自由光的...
来源: Laya3.0_文档 发布时间: 20250214
...oTexture; this.owner.xxx.getChildByName('Scene3D').getChildByName('Plane').getComponent(Laya.MeshRenderer).sharedMaterial = mat; // 上面代码在3D场景中播放则无任何问题,包括微信浏览器,出问题的是在2D场景中在微信浏览器不能播放视频 // 附件三张图片...
来源: Laya_社区 发布时间: 20230825
...碰撞器就获取不到了,一直报空 (this.owner as Laya.Sprite3D).getComponent(Laya.PhysicsCollider) as Laya.PhysicsCollider;log里面也没有这个碰撞组件的信息,只有刚体和脚本的 但是把刚体去掉以后再导出,代码再去获取这个物体身上的碰撞器就...
来源: Laya_社区 发布时间: 20200927
...xture = this.videoTexture; //将材质应用到Sprite3D上 this.videoPlane.getComponent(Laya.MeshRenderer).sharedMaterial = mat; } } 效果如图所示: 下面我们来介绍一下videoTexture中常用的属性和方法,开发者也可以在API文档中查看videoTexture的所有属性和方法...
来源: Laya3.0_文档 发布时间: 20250214
...每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 onLateUpdate 每帧更新时执行,在onUpdate之后执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 onPreRender 渲染之前执行 onPostRender 渲染之后执行 onDisable ...
来源: Laya3.0_文档 发布时间: 20250103