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

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

11. 使用3D摄像机 · LayaAir3.4 · 引擎文档 · LAYABOX [ 66%]

...会执行一次 * 此方法为虚方法,使用时重写覆盖即可 */ onStart(): void { this.camera = this.owner as Laya.Camera; if (this.target) { this.target.transform.position.cloneTo(this.curpos); this.delatpos = new Laya.Vector3(); } } /** * 每帧更新时执行,尽量不要在这里写...

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

12. 组件装饰器说明 · LayaAir3.4 · 引擎文档 · LAYABOX [ 66%]

...h.PI / 180);//把输入的角度值,转成弧度给_radian存起来。 } onStart() { console.log(this._radian); } } 2.4 是否为私有属性(影响面板可见) 除了前文中提到的hidden这个属性标识参数会影响属性在面板上是否可见之外。private参数也会影响属...

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

13. 内置骨骼动画 · LayaAir3.4 · 引擎文档 · LAYABOX [ 66%]

...Script { private mCurrIndex: number = 0; private mArmature: Laya.Skeleton; onStart() { console.log("Game start"); //加载内置骨骼动画资源 Laya.loader.load("skeleton/Dragon/Dragon.sk").then((templet: Laya.Templet) => { //创建模式为1,可以启用换装 this.mArmature = templet.build...

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

14. 项目启动入口说明 · LayaAir3.4 · 引擎文档 · LAYABOX [ 65%]

...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { console.log("Game start"); } } 2.2 场景的脚本说明 前面讲了项目的入口, 本小节简述一下场景的脚本。场景的脚本主要是两类, 一类是自定义的组件脚本。这种脚本,...

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

15. Windows扩展 · LayaAir3.4 · 引擎文档 · LAYABOX [ 61%]

...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { alert(testLib.nativeAdd(10, 11)); } } 因为LayaNative的扩展功能只支持Windows平台,所以只能通过Windows预览或发布为Windows项目才能得到正确的结果。运行效果如图3-2所示, ...

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

16. [LayaAir3]Pool对象池获取继承对象时会返回基类对象 [ 61%]

...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { let item1 = Laya.Pool.createByClass(TestClass); console.log('item1:', item1.type); Laya.Pool.recoverByClass(item1); let item2 = Laya.Pool.createByClass(TestClass2); console.log('item2:', item2.type); console.log(i...

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

17. 引用外部脚本的方式 · LayaAir3.4 · 引擎文档 · LAYABOX [ 59%]

...xport class Main extends Laya.Script { private aStarInstance: AStarFinder; onStart() { console.log("Game start"); // 0表示通路,1表示障碍 let myMatrix = [ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0], [1, 1,...

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

18. 加载.lh文件 运行后黑屏 无法显示 [ 58%]

...        this.first = true;         this.twoFirst = true; } onStart(){ this._scene = this.owner.parent as Laya.Scene3D;         this._text = this._scene.parent.getChildByName("ceshi") as Laya.Text;         this._camera = this._scene.getChildByName("camera") as Laya.Cam...

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

19. [LayaAirIDE3]2d相机打包后问题 [ 56%]

...cript: Joystick;     private cameraController: CameraController;      onStart() {         // 初始化组件引用         this.playerScript = this.player.getComponent(Player);         this.joystickScript = this.joystick.getComponent(Joystick);         this.cameraController = th...

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

20. [0]laya-zip游戏加载提速库(Laya3.0版本适配更新) [ 54%]

...s和laya-zip.d.ts文件放入项目中,IDE中勾选并应用 在Main.ts中 onStart()中加入:[code]LayaZip.Init(); // 3.0版本下建议配置为1 LayaZip.BasePathMode = 1;[/code] 需要注意的一点是: 在Laya 3.x版本下制作资源zip包时,使用的是构建发布后的release文件夹...

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