大约有 395 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0046 秒)
...为创建多光源的代码 代码参考“引擎API使用示例” export class MultiLight extends BaseScript { constructor() { super(); } onAwake(): void { var moveScript: LightMoveScript = this.camera.addComponent(LightMoveScript); var moverLights: Laya.Sprite3D[] = moveScript.lights; var offsets...
来源: Laya3.0_文档 发布时间: 20240624
... ```typescript /** * TypeScript语言的3D脚本示例 */ export default class TSDemo extends Laya.Script3D { constructor() { super(); } } ``` > 2D脚本与3D脚本不要混用,如果是用IDE创建的脚本模板,需要将继承的2D脚本类(Laya.Script)改为3D脚本类(Laya.Script3D)...
来源: Laya2.0_文档 发布时间: 20210715
...的移动,摄像机的位置也同步移动,代码如下: const { regClass, property } = Laya; @regClass() export default class CameraControll extends Laya.Script { @property( { type: Laya.Sprite3D } ) public target: Laya.Sprite3D; private camera: Laya.Camera; public distanceUp: number = 0.5;/...
来源: Laya3.0_文档 发布时间: 20231214
...在脚本中监听到事件和参数了,脚本代码如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; constructor() { super(); } event1(p1:any, p2:any): void { console.log("event1",p1,p2); } } 在脚本中创建eve...
来源: Laya3.0_文档 发布时间: 20230519
...脚本, (图2-22) 然后在脚本中添加如下代码: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执...
来源: Laya3.0_文档 发布时间: 20240926