当前位置:网站首页>Unity webgl mobile end removal warning
Unity webgl mobile end removal warning
2022-06-28 12:29:00 【Qi Dake】
modify Build\UnityLoader.js.
Replace the following code with false
UnityLoader.SystemInfo.mobile // Replace with false
["Edge", "Firefox", "Chrome", "Safari"].indexOf(UnityLoader.SystemInfo.browser) == -1 // Replace with falseTo avoid manual changes every time you build , Use PostBuildHandler Script .Editor Create PostBuildHandler Script
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
public class PostBuildHandler
{
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget target, string targetPath)
{
if (target != BuildTarget.WebGL) return;
var path = Path.Combine(targetPath, "Build/UnityLoader.js");
var text = File.ReadAllText(path);
text = text.Replace("UnityLoader.SystemInfo.mobile", "false");
text = text.Replace("[\"Edge\",\"Firefox\",\"Chrome\",\"Safari\"].indexOf(UnityLoader.SystemInfo.browser)==-1", "false");// Notice the spaces in the string
File.WriteAllText(path, text);
}
}边栏推荐
- MapReduce project case 3 - temperature statistics
- Unity加载设置:Application.backgroundLoadingPriority
- Bytev builds a dynamic digital twin network security platform -- helping network security development
- 设置Canvas的 overrideSorting不生效
- Two writing methods of JNI function
- 模板_大整数乘法
- 如何获取泛型的类型
- Matplotlib_Study01
- 杰理之wif 干扰蓝牙【篇】
- 【Unity编辑器扩展实践】、利用txt模板动态生成UI代码
猜你喜欢

UGUI使用小技巧(六)Unity实现字符串竖行显示
Three ways to implement LRU cache (recommended Collection)

【C语言】随机数文件对其进行三种排序方法

深度学习又有新坑了!悉尼大学提出全新跨模态任务,用文本指导图像进行抠图...

RemoteViews布局和类型限制源码分析

不到一小时,苹果摧毁了15家初创公司

Function and principle of remoteviews
![[unity Editor Extension practice], find all prefabrications through code](/img/0b/10fec4e4d67dfc65bd94f7f9d7dbe7.png)
[unity Editor Extension practice], find all prefabrications through code
![[vi/vim] basic usage and command summary](/img/bc/0be3ae3f122c3c21b480e0678095a1.png)
[vi/vim] basic usage and command summary

Leetcode 48. 旋转图像(可以,已解决)
随机推荐
What are the common modes of financial products in 2022?
【编解码】从零开始写H264解码器(1) 总纲
分页样式 flex设置成在尾部显示(即使页数加长 也不会因为在末尾而换行)
【Unity编辑器扩展实践】、查找所有引用该图片的预制体
ASP.NET CORE Study01
杰理之wif 干扰蓝牙【篇】
【Unity编辑器扩展基础】、EditorGUILayout (一)
RemoteViews的作用及原理
Using MySQL database in the express framework of node
30套JSP网站源代码合集「建议收藏」
Leetcode 705. 设计哈希集合
期货开户有门槛吗,如何网上安全的开通期货账户
UDP传输rtp数据包丢帧
URL append parameter method, considering #$ Situation of
结构光之相移法+多频外差的数学原理推导
ASP.NET CORE Study07
RemoteViews布局和类型限制源码分析
Two writing methods of JNI function
杰理之wif 干扰蓝牙【篇】
KDD 2022 | 图“预训练、提示、微调”范式下的图神经网络泛化框架