大约有 14 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0037 秒)
...行监听网络变化,代码如下: if( conch ) { conch.setNetworkEvtFunction(function(type) { alert(type) }); } 注意: 1、conch只能在LayaNative环境下调用,在网页版本中是没有conch定义的,所以需要判断一下是否存在。 在LayaAir-IDE中的脚本中添加代码...
来源: Laya3.0_文档 发布时间: 20251010
...行,默认为 true 。 */ frameOnce(delay: number, caller: any, method: Function, args: any[] = null, coverBefore: boolean = true): void { this._create(true, false, delay, caller, method, args, coverBefore); } 使用示例如下: const { regClass } = Laya; import { RuntimeScriptBase } from "./Ru...
来源: Laya3.0_文档 发布时间: 20251010
...函数默认在config.js中定义,代码如下: window.onLayaInitError=function(e) { console.log("onLayaInitError error=" + e); alert("加载游戏失败,可能由于您的网络不稳定,请退出重进"); } 开发者可以根据自己需求,修改报错信息和报错方式。 9. 获取...
来源: Laya3.0_文档 发布时间: 20251010
...env env, jsvm_value exp) { //注册新的函数 jsvm_value fn; jsvm_create_function(env, "testAdd", SIZE_MAX, jsAdd, nullptr, &fn); jsvm_set_named_property(env, exp, "nativeAdd", fn); jsvm_value fn1; jsvm_create_function(env, "testStr", SIZE_MAX, jsStr, nullptr, &fn1); jsvm_set_named_propert...
来源: Laya3.0_文档 发布时间: 20251010
...的一个对象。 */ static getItemByCreateFun(sign: string, createFun: Function, caller: any = null): any { var pool: any[] = Pool.getPoolBySign(sign); var rst: any = pool.length ? pool.pop() : createFun.call(caller); rst[Pool.POOLSIGN] = false; return rst; } 基于上述的情况,如果对象...
来源: Laya3.0_文档 发布时间: 20251010
...p) { ... // 注册Steam初始化函数 jsvm_value fnInitSteam; jsvm_create_function(env, "initializeSteam", SIZE_MAX, jsInitializeSteam, nullptr, &fnInitSteam); jsvm_set_named_property(env, exp, "initializeSteam", fnInitSteam); } } 2.2 生成动态链接库 生成动态链接库与其使用的...
来源: Laya3.0_文档 发布时间: 20251010
...(ret); conch.postAsyncMessage("asyncMessage", "asyncMessage from js").then(function (data) { alert(data); }) 1.2 在原生端中主动执行JS端脚本 iOS/OC执行JS脚本: [[conchRuntime GetIOSConchRuntime] runJS:@"alert('hello')"]; Android/Java执行JS脚本: ConchJNI.RunJS("alert('hello worl...
来源: Laya3.0_文档 发布时间: 20251010
...ath = ""; } Pool.getInstance().ClearGroup("Particle3D@" + root_path, this, function(particle_3d:Particle3D) { particle_3d.Clean(); }); } } 5.2 自定义对象池类 export class Pool { private _poolDic:{[key: string]: any;} = {}; private InPoolSign: string = "__InPool"; constructor() { } private sta...
来源: Laya3.0_文档 发布时间: 20251010
...ath = ""; } Pool.getInstance().ClearGroup("Particle3D@" + root_path, this, function(particle_3d:Particle3D) { particle_3d.Clean(); }); } } 5.2 自定义对象池类 export class Pool { private _poolDic:{[key: string]: any;} = {}; private InPoolSign: string = "__InPool"; constructor() { } private sta...
来源: Laya3.0_文档 发布时间: 20250104
...: //设置鼠标弹起事件响应 Laya.stage.on(Event.MOUSE_UP, this, function (): void { //起始和目标点 var start = this.graph.grid[this.startPoint.x][this.startPoint.y]; var end = this.graph.grid[this.endPoint.x][this.endPoint.y]; //调用A* serach方法获得最短路径 this._everyPath ...
来源: Laya3.0_文档 发布时间: 20230303