大约有 18 项符合查询结果, 库内数据总量为 30,897 项。 (搜索耗时: 0.0045 秒)
...this.spriteLight.pos(100,350); let spritelightComponent = this.spriteLight.getComponent(Laya.SpriteLight2D); spritelightComponent.color = new Laya.Color(1, 1, 1); spritelightComponent.intensity = 0.5; let tex = Laya.loader.getRes("resources/spritelight.png"); spritelightComponent.spriteTexture = tex...
来源: Laya3.0_文档 发布时间: 20250214
...此方法只执行一次 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
...nsform.localPosition = new Laya.Vector3(0,5,5); let p3dRenderer = this.p3d.getComponent(Laya.ShurikenParticleRenderer); p3dRenderer.particleSystem.simulationSpeed = 10; } 通过暴露@property( { type :Laya.Sprite3D } )节点类型属性,来拖入particle节点,可以获得particle节点对象...
来源: Laya3.0_文档 发布时间: 20250103
...eSprite3D: Laya.PixelLineSprite3D, color: Laya.Color): void { if (sprite3D.getComponent(Laya.MeshFilter)) { var mesh: Laya.Mesh = sprite3D.getComponent(Laya.MeshFilter).sharedMesh; var positions: Array<Laya.Vector3> = []; mesh.getPositions(positions); var indices = mesh.getSubMesh(0).getIndice...
来源: Laya3.0_文档 发布时间: 20250103
...每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 onLateUpdate 每帧更新时执行,在onUpdate之后执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 onPreRender 渲染之前执行 onPostRender 渲染之后执行 onDisable ...
来源: Laya3.0_文档 发布时间: 20250103
...xture = this.videoTexture; //将材质应用到Sprite3D上 this.videoPlane.getComponent(Laya.MeshRenderer).sharedMaterial = mat; } } 效果如图所示: 下面我们来介绍一下videoTexture中常用的属性和方法,开发者也可以在API文档中查看videoTexture的所有属性和方法...
来源: Laya3.0_文档 发布时间: 20250214
...id { this.spotLight.pos(336, 280); let spotLightComponent = this.spotLight.getComponent(Laya.SpotLight2D); spotLightComponent.color = new Laya.Color(1, 0.812, 1); spotLightComponent.intensity = 1.0; spotLightComponent.innerRadius = 50; spotLightComponent.outerRadius = 200; spotLightComponent.innerAn...
来源: Laya3.0_文档 发布时间: 20250214
...略若干代码 */ //获取物理刚体组件 this.rigidbody1 = this.cube1.getComponent(Laya.Rigidbody3D) as Laya.Rigidbody3D; this.rigidbody2 = this.cube2.getComponent(Laya.Rigidbody3D) as Laya.Rigidbody3D; //设置rigidbody1为触发器,取消物理反馈 this.rigidbody1.isTrigger = true; this.rig...
来源: Laya3.0_文档 发布时间: 20250103
... // 文本显示当前时间 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
...ake(): void { // 获取 FreeformLight2D 组件 this.lightComp = this.owner.getComponent(Laya.FreeformLight2D); //灯光的顶点通常建议是在IDE中可视化配置,这里是为了演示如何通过代码动态设置顶点数据,方便动态调整灯光形状的需求。 /**设置自由光的...
来源: Laya3.0_文档 发布时间: 20250214