大约有 6 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0034 秒)
...2-2所示 (动图2-2) 2,传参与接收参数 项目中有Scene.ls和Msg.ls两个场景,可以在Scene场景中通过 Laya.Scene.open 附带传递参数给Msg场景,代码如下所示: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property...
来源: Laya3.0_文档 发布时间: 20251010
...ayaAir WebSocket!"); } /** 接收数据回调 */ private onMessageReceived(msg: any): void { console.log("接收到消息:"); if (typeof msg === "string") { console.log("文本数据:", msg); } else { console.log("接收到非字符串数据", msg); } // 清除输入缓存,避免残留数据 t...
来源: Laya3.0_文档 发布时间: 20251010
...需要读取出来,转成我们需要的类型。 private receiveHandler(msg: any = null): void { ///接收到数据触发函数 //.............这里我们假设收到的是二进制ArrayBuffer this.byte.clear(); this.byte.writeArrayBuffer(msg);//把接收到的二进制数据读进byte数组便...
来源: Laya3.0_文档 发布时间: 20250104
...不同的资源URL string function getListItemResource(index:number) { let msg = _messages[index]; if (msg.fromMe) return "url1.lh"; else return "url2.lh"; } 然后设置这个函数为列表的item提供者: aList.itemProvider = getListItemResource; 对于横向流动、竖向流动和分页的...
来源: Laya3.0_文档 发布时间: 20251128
...{ // 是否进行过初始化 if (m_bInitialized) { return true; } SteamErrMsg msg; if (SteamAPI_InitEx(&msg) != ESteamAPIInitResult::k_ESteamAPIInitResult_OK) { // Steam初始化失败, 请确保Steam客户端正在运行 return false; } m_bInitialized = true; return true; } 然后在exports.cp...
来源: Laya3.0_文档 发布时间: 20251010
...要,也可以省略这个声明 static test(this: IEditorEnv.IGameScene, msg: string) { console.log(msg); //hello return "ok"; } } //下面是UI进程的代码 let ret = await Editor.scene.runScript("TestSceneScript.test", "hello"); console.log(ret); //ok 特别的用法,可以通过window对象...
来源: Laya3.0_文档 发布时间: 20251010