大约有 23 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0119 秒)
...r.create(this, this.onSuccess), Laya.Handler.create(this, this.onError) ); console.log("click"); } // 成功获取位置后触发 onSuccess(info: Laya.GeolocationInfo): void { console.log('经纬度: (' + info.longitude + '°, ' + info.latitude + '°),精确度:' + info.accuracy + 'm'); if (info...
来源: Laya3.0_文档 发布时间: 20251010
...功回调,发送字符串数据 */ private onSocketOpen(e: any): void { console.log("WebSocket 已连接"); // 发送字符串示例 this.socket.send("Hello, LayaAir WebSocket!"); } /** 接收数据回调 */ private onMessageReceived(msg: any): void { console.log("接收到消息:"); if (typeof ...
来源: Laya3.0_文档 发布时间: 20251010
...wake不同的是即使节点未激活onAdded也会调用 onAdded(): void { console.log("Game onAdded"); } //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { console.log("Game onAwake"); } //组件被启用后执行,比如节点...
来源: Laya3.0_文档 发布时间: 20251010
...wake不同的是即使节点未激活onAdded也会调用 onAdded(): void { console.log("Game onAdded"); } //重置组件参数到默认值,如果实现了这个函数,则组件会被重置并且自动回收到对象池,方便下次复用。如果没有重置,则不进行回收复用 onReset(...
来源: Laya3.0_文档 发布时间: 20251010
...gnore wx.setUserCloudStorage({ KVDataList: KVDataList, success: () => { console.log("数据保存成功") }, fail: () => { console.log("数据保存失败") }, complete: () => { console.log("执行调用结束回调") } }); } } 然后是getFriendCloudStorage方法,来到开放数据域的...
来源: Laya3.0_文档 发布时间: 20251010
...LICK 的(以下代码来自“2D入门示例”): onEnable(): void { console.log("IndexRT onEnable") //侦听ui按钮点击事件 this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开UI场景示例 console.log("uiBtn"); Laya.Scene.open("scenes/UiMain.ls"); }); //侦听物理按...
来源: Laya3.0_文档 发布时间: 20251010
...10; i++) Laya.timer.callLater(this, this.hideImage); } hideImage(): void { console.log("hideImage"); this.Image.visible = false; } } 5. 清理定时器 Laya.timer.clear:清理指定的定时器。定义如下: /** * 清理定时器。 * @param caller 执行域(this)。 * @param method 定时器...
来源: Laya3.0_文档 发布时间: 20251010
...ent.MOUSE_DOWN, this, this.test2);//设置监听,sprite1或sprite2均可 console.log(this.sprite1.mouseEnabled);//打印父节点sprite1的MouseEnabled的值:true console.log(this.sprite2.mouseEnabled);//打印子节点sprite2的MouseEnabled的值:true } test2(e: Laya.Event) { console.log('mou...
来源: Laya3.0_文档 发布时间: 20251010
...}) get testParams():string{ return "test"; } set testParams(value:string){ console.log(value); } // 静态 get & set @bpAccessor({ "type":"string", "modifiers": { "isStatic": true } }) static get testStaParams():string{ return "test"; } static set testStaParams(value:string){ console.log(value);...
来源: Laya3.0_文档 发布时间: 20251010
...SS, this, this.processHandler); } private processHandler(data:any): void { console.log("processHandler"); } private errorHandler(error:any): void { console.log("errorHandler"); } private completeHandler(data:any): void { console.log("completeHandler"); } } new LayaSample(); 2.2 GET 上面这个示...
来源: Laya3.0_文档 发布时间: 20250104