当前位置:网站首页>一波骚操作解决Laya场景编辑器报错问题
一波骚操作解决Laya场景编辑器报错问题
2022-07-28 14:40:00 【我不是码神】
重装完系统后,打开Laya IDE,当我切换到场景编辑器的时候,弹出错误框让我备受煎熬。
我一遍心里骂娘一遍给Laya社区BBS发帖求助,也没有人回音。怎么办,总不能再重装一遍系统吧,这不是我的风格,那就只好硬着头皮去解决这个问题了。
从弹窗中大致看到源码位置,打开源码文件夹全局搜索webGL!找到弹窗位置了!
在文件LayaAirIDE\resources\app\out\vs\layaEditor\h5\renders\uiviewer\editor.max.js
的88880行
if (!WebGL.enable()){
alert("Laya3D init error,must support webGL!");
return;
}嗯,是因为IDE需要用到WebGL功能,打开开发者工具,创建一个canvas,然后调用getContext('webgl')返回null,确实不支持。奇怪,为什么不支持呢?原来是好好的啊。
经过1天的思考,没啥思路,上网搜索一把,终于发现了重要线索:
原来如此,可以尝试一下这个骚操作,问题是这个代码放哪儿呢?文章没有说。我把代码放到一个页面里面,失败,很显然这个貌似是electron的代码,于是我根据package.json中的入口js找到resources/app/out/main.js,把代码插入其中
init() {
let idepath = this.path.join(this.app.getPath("appData"), "LayaAirIDE");
this.fs.exists(idepath, function (exists) {
if (!exists) {
require("fs").mkdir(idepath);
}
});
this.app.commandLine.appendSwitch('ignore-gpu-blacklist');
this.app.once("ready", () => {
this.start();
});
this.ipcMain.on("openFile", () => {
console.log("----------------------------收到消息")
console.log(process.argv, "-------------------------")
})
}重启Laya,不弹窗了,成功!
基于Electron开发的软件会有想不到的坑,也因为可以修改软件代码来解决,js真是好用!
边栏推荐
- 手把手带你编写一个规范的字符设备驱动
- 关于word文档中插入的图片只显示下面一部分
- GRC concept GRC architecture RPC lifecycle
- 8、实时数据备份和实时时钟功能实现
- subst命令将一个文件夹镜像成本地的一个磁盘
- Share the HR experience of the first and second tier companies
- MIT指出公开预训练模型不能乱用
- Among the three "difficult and miscellaneous diseases" of machine learning, causal learning is the breakthrough | Liu Li, Chongqing University
- 1. Author of the open source GPS project hd-gr GNSS
- Five connection modes of QT signal and slot
猜你喜欢
随机推荐
Pycharm - output exception of program run and default comment of added function
Easyexcel complex header export (one to many)
9、相关数据累积任务定义
Editor in ArcGIS Pro
腾讯面试之--请你设计一个实现线程池顺序执行
22、电文处理任务实现
samba服务器搭建指南
如何获取及嵌入Go二进制执行包信息
2. Self narration of open source GPS project hd-gr GNSS
Framework定制系列(十)-----SystemUI定制状态栏statusbar和导航栏navigationbar教程
Framework定制系列(一)-----SystemUI NavigationBar导航栏上滑返回Launcher
机器学习的3大“疑难杂症”,因果学习是突破口 | 重庆大学刘礼
Baidu proposes a dynamic self distillation method to realize dense paragraph retrieval by combining interactive model and double tower model
MIT pointed out that the public pre training model should not be used indiscriminately
How to write a JMeter script common to the test team
Grpc frequently asked questions
Some operations of bit operation
samba服务器如何配置
Grpc protocol buffer
800V高压系统









