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

大约有 15 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0049 秒)

1. 组件属性的代码使用 · LayaAir3.0文档 · LAYABOX [ 100%]

...nderer: Laya.ShurikenParticleRenderer; onAwake(): void { (this.p3dRenderer.owner as Laya.Sprite3D).transform.localPosition = new Laya.Vector3(0,5,5); this.p3dRenderer.particleSystem.simulationSpeed = 10; } 通过暴露@property( { type : Laya.ShurikenParticleRenderer } )组件类型属性,来拖...

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

2. UI运行时 · LayaAir3.0文档 · LAYABOX [ 95%]

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

3. 基础文本 · LayaAir3.0文档 · LAYABOX [ 94%]

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

4. 使用二进制图片 · LayaAir3.0文档 · LAYABOX [ 91%]

... //加载Base64图片数据 sp1.loadImage(e.target.result as string); this.owner.addChild(sp1); } }); 上述代码中,用 Laya.loader.fetch 加载图片二进制数据,根据自定义的规则,可以解析数据加密方式,并获得完整图片数据。在这里我们更多的介绍一下 L...

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

5. 实体组件系统 · LayaAir3.0文档 · LAYABOX [ 81%]

...; } onEnable(): void { //设置初始速度 let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: any, contact: any): void { //如果被碰到,则移除子弹 this.owner.removeSelf(); } onUpdate(): void { //如果...

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

6. 精灵 · LayaAir3.0文档 · LAYABOX [ 73%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Sprite }) public sprite1: Laya.Sprite; @property({ type: Laya.Sprite }) public sprite2: Laya.Sprite; constructor() { super(); } /** * 组件被激活后执行,此时所有节点...

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

7. 3D物理编辑 · LayaAir3.0文档 · LAYABOX [ 69%]

...his.out); //将射线碰撞到的物体设置为红色 ((this.out.collider.owner).getComponent(Laya.MeshRenderer).sharedMaterial as Laya.BlinnPhongMaterial).albedoColor = new Laya.Color(0.0, 1.0, 0.0, 1.0); /* ……省略若干代码 */ 4.4 使用异形物理射线 常规的物理射线是用一条...

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

8. 微信小游戏 · LayaAir3.0文档 · LAYABOX [ 67%]

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

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

9. 抖音小游戏 · LayaAir3.0文档 · LAYABOX [ 66%]

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

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

10. 使用3D精灵 · LayaAir3.0文档 · LAYABOX [ 65%]

...vent.MOUSE_UP, this, this.mouseUp); this.camera = (<Laya.Camera>this.owner); } /** * 监听键盘事件 */ onUpdate(): void { var elapsedTime: number = Laya.timer.delta; if (!isNaN(this.lastMouseX) && !isNaN(this.lastMouseY) && this.isMouseDown) { Laya.InputManager.hasKeyDown(8...

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