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

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

31. 添加组件code里面自定义脚本不显示 [ 75%]

...没必要无限循环检查继承关系,开发者只能是采用注释加extends Laya.script这个关键字来解决了。   当前的版本,请先用你自己证实的注释+继承脚本的方式,显示出来吧。 2021-10-18 0 6 分享 微博 QZONE 微信 柠檬_酸 赞同来自: 你的dem...

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

32. 进度条组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 75%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.ProgressBar }) public progressBar: Laya.ProgressBar; @property({ type: Laya.Text }) public loadText: Laya.Text; //组件被激活后执行,此时所有节点和组件均已创建...

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

33. LayaIDE 2.13.0 添加组件菜单无法显示二级继承的子类 [ 74%]

...无法显示二级继承的子类 实例代码 export default class View1 extends Laya.Script { }   import View1 from "./View1"; export default class View2 extends View1 { }升级到2.13.0后,在编辑模式属性面板点击【添加组件】按钮,显示的【Code】菜单下只有View1,没...

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

34. laya2.0 编辑器不显示父类变量 [ 74%]

laya2.0 编辑器不显示父类变量 举个粒子 class Parent extends Laya.Script{ /** @prop {name:name, type:string}*/ public name; } class Child extends Parent{} 在编辑器中给对象挂child脚本,并没有显示父类的name对象。 2018-12-13 添加评论 免费帖 --> 分享 微博 Q...

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

35. 实体组件系统 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

...逻辑及对象池回收机制 */ @regClass() export default class Bullet extends Laya.Script { constructor() { super(); } onEnable(): void { //设置初始速度 let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: ...

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

36. 开放数据域组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

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

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

37. 组件脚本的内置方法 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

...例如下: const { regClass } = Laya; @regClass() export class NewScript extends Laya.Script { //被添加到节点后调用,和Awake不同的是即使节点未激活onAdded也会调用 onAdded(): void { console.log("Game onAdded"); } //组件被激活后执行,此时所有节点和组件均...

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

38. 新人求助:onStart赋值为什么在onUpdate会输出一次为空 [ 74%]

...什么在onUpdate会输出一次为空   export default class mtTest extends Laya.Script{          lab:Laya.Label;      onAwake():void{             }     onStart():void{                this.lab=this.owner as Laya.Label;         }      ...

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

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

...Vector4; import WebGLContext = Laya.WebGLContext; export class SceneScript extends Script { private _originPosition:Vector3 = new Vector3(0, -1, 1); private _phasorSpriter3D:PhasorSpriter3D; private _color:Vector4 = new Vector4(1, 0, 0, 1); private _point:Vector2 = new Vector2(); private _camera:Cam...

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

40. 组件属性的代码使用 · LayaAir3.3 · 引擎文档 · LAYABOX [ 73%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type : Laya.Sprite}) public spr: Laya.Sprite; onAwake(): void { this.spr.size(512, 313); //设置Sprite大小 this.spr.loadImage("atlas/comp/image.png"); //添加纹理 } } 效果如图1-2所...

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