大约有 130 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0055 秒)
...lass() export class MsgRT extends MsgRTBase { onOpened(param: any): void { console.log(param.text); } } 这样,点击Scene场景中的Button,就会打印日志“点击成功!”,效果如动图2-3所示: (动图2-3) 2.3 关闭场景 1,关闭指定的场景 /** * 根据地址,关...
来源: Laya3.0_文档 发布时间: 20251010
...operty( { type : Laya.Scene3D } ) private scene: Laya.Scene3D; onStart() { console.log("Game start"); //加载预制体文件 Laya.loader.load("resources/Prefab.lh").then( (res)=>{ //创建预制体 let monkey: Laya.Sprite3D = res.create(); //添加预制体到场景中 this.scene.addChild( monke...
来源: Laya3.0_文档 发布时间: 20241014
...er = new Worker("js/my_task.js"); myWorker.onmessage = function (oEvent) { console.log("Called back by the worker!\n"); }; myWorker.postMessage("start"); // start the worker. 新建一个my_task.js文件,放到js文件夹下,代码如下: self.addEventListener('message', function (e) { var xml...
来源: Laya3.0_文档 发布时间: 20251010
...operty( { type : Laya.Scene3D } ) private scene: Laya.Scene3D; onStart() { console.log("Game start"); //加载预制体文件 Laya.loader.load("resources/Prefab.lh").then( (res)=>{ //创建预制体 let monkey: Laya.Sprite3D = res.create(); //添加预制体到场景中 this.scene.addChild( monke...
来源: Laya3.0_文档 发布时间: 20251105
...g) { Game.runing = true; Game.stepNum = Math.floor(Math.random() * 6) + 1; console.log(Game.stepNum) Animate.role(Game.stepNum); } },[this.items.shaizi]); 弹层的代码: this.prizeAlertLayer = new Sprite(); this.prizeAlertLayer.zOrder = 90; this.prizeAlertLayer.size(W, H); let bg = new Spri...
来源: Laya_社区 发布时间: 20180601
...不生效。我在上一页文本上增加了点击事件,click后应该console.log,但是现在没有反应。 study.rar附件是小游戏的demo。 gif附件是bug的录像。 附件 : --> study.rar 2018-04-23 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结...
来源: Laya_社区 发布时间: 20180423
...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
...e.runNodeScript(node.id, node.getComponent("MyScript").id, "test", "abc"); console.log(ret); 3、自定义一个函数,并执行。例如: //下面是场景进程的代码 //注意:IEditorEnv.regClass是必须的 @IEditorEnv.regClass() export class TestSceneScript { //注意:this是当前的...
来源: Laya3.0_文档 发布时间: 20251010
...orker = new Worker("my_task.js"); myWorker.onmessage = function (oEvent) { console.log("Called back by the worker!\n"); }; myWorker.postMessage("start"); // start the worker. ``` 新建一个my_task.js文件,代码如下: ```typescript self.addEventListener('message', function (e) { var xmlreq =...
来源: Laya2.0_文档 发布时间: 20210715
...t:Laya.Socket = new Laya.Socket(); socket.on(Laya.Event.OPEN,this,()=>{ console.log("connect success!"); }) socket.connectByUrl(url);点此查看Socket官方示例 2018-05-15 1 0 分享 微博 QZONE 微信 rabbit 赞同来自: 只要前端的,还是要前端和后端代码? 2018-05-15 0 1 分...
来源: Laya_社区 发布时间: 20180514