当前位置:网站首页>一波骚操作解决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真是好用!
边栏推荐
- 800V high voltage system
- Among the three "difficult and miscellaneous diseases" of machine learning, causal learning is the breakthrough | Liu Li, Chongqing University
- Share the HR experience of the first and second tier companies
- Endnote 与word关联
- Camera连拍自动化测试shell脚本
- 软件架构与设计(四)-----数据流架构
- VS使用技巧
- 全国211院校考研信息汇总整理
- 8. Realization of real-time data backup and real-time clock function
- Svg verification code recognition experience
猜你喜欢

Among the three "difficult and miscellaneous diseases" of machine learning, causal learning is the breakthrough | Liu Li, Chongqing University

Template injection summary

Pycharm - output exception of program run and default comment of added function

Flowable workflow all business concepts

Canoe tutorial

简单入手Swagger
![[jspwiki]jspwiki installation deployment and configuration](/img/3c/81a201bb80dcbb17d1c97b1a5bb215.png)
[jspwiki]jspwiki installation deployment and configuration

机器学习的3大“疑难杂症”,因果学习是突破口 | 重庆大学刘礼

MIT指出公开预训练模型不能乱用

基于RSocket协议实现客户端与服务端通信
随机推荐
4.8 HD-GR GNSS导航软件源码
Qt刷新UI界面问题
[jspwiki]jspwiki installation deployment and configuration
File and directory operations (5)
Deepfacelab model parameters collection
20. Channel allocation task implementation
Stateflow逻辑系统建模
【删除指定数字——leetcode]
NFTScan 与 NFTPlay 在 NFT 数据领域达成战略合作
sql语句的执行流程
Five connection modes of QT signal and slot
String (3)
提速1200倍!MIT开发新一代药物研发AI,吊打老模型
ECCV 2022 | ssp: a new idea of small sample tasks with self-supporting matching
Write a standard character device driver with your hands
9、相关数据累积任务定义
字符串(3)
Opencv - closely combine multiple irregular small graphs into large graphs
爆肝整理 JVM 十大模块知识点总结,不信你还不懂
ECCV 2022 | SSP: 自支持匹配的小样本任务新思想