大约有 140 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0294 秒)
...户的手势操作时,才会返回地理信息。所以如果直接放在onStart()等全局方法里面是不行的,得是像onMouseClick()这样的手势事件的响应函数才可以。 获取位置信息需要开启代理。 2、监视位置改变 除了获取当前位置之外,还可以监...
来源: Laya3.0_文档 发布时间: 20251010
...0); img.skin = "resources/layabox.png"; //纹理压缩的图片的路径 } onStart() { Laya.Stat.show(0, 0); //性能面板 } } 发布后,使用的图片就是压缩后的图片了。 3.2 图集纹理压缩的加载 对于2D图集,预加载图集atlas文件即可,引擎在加载图集的时候...
来源: Laya3.0_文档 发布时间: 20251010
...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { console.log("Game start"); } } 2.2 场景的脚本说明 前面讲了项目的入口, 本小节简述一下场景的脚本。场景的脚本主要是两类, 一类是自定义的组件脚本。这种脚本,...
来源: Laya3.0_文档 发布时间: 20251216
... 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
...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
... 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_社区 发布时间: 20190605
...cript: Joystick; private cameraController: CameraController; onStart() { // 初始化组件引用 this.playerScript = this.player.getComponent(Player); this.joystickScript = this.joystick.getComponent(Joystick); this.cameraController = th...
来源: Laya_社区 发布时间: 20251125
...super(); } /** * 第一次执行update之前执行,只会执行一次 */ onStart(): void { //创建Loading场景 this.loadingScene = this.loadingScenePrefab.create(); //设置Loading场景 Laya.Scene.setLoadingPage(this.loadingScene as Laya.Sprite); //手动调用显示Loading场景 Laya.Scene.sho...
来源: Laya3.0_文档 发布时间: 20251010
... this.translate = new Laya.Vector3(0,0,0); } onStart(){ this.scene = this.owner.parent; this.text = this.scene.parent.getChildByName("ceshi"); this.camera = this.scene.getChildByName("camera"); } onUpdate(){...
来源: Laya_社区 发布时间: 20190531
...。 在LayaAir3.0中,Component具有完整的生命周期,即onAwake,onStart,onEnable,onUpdate,onLateUpdate,onDisable,onDestroy,不再使用_onEnable,_onDisable等下划线函数。 _onEnable,_onDisable等下换线函数仍然给内部使用 对比Component, Script增加了交互行为,即on...
来源: Laya3.0_文档 发布时间: 20251010