当前位置:网站首页>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);
}
}边栏推荐
猜你喜欢

UGUI使用小技巧(五) Scroll Rect组件的使用

智联招聘基于 Nebula Graph 的推荐实践分享

newest! Introduction and practical tutorial of point cloud processing based on open3d

ASP.NET CORE Study09

Remoteviews layout and type restriction source code analysis

websocket 1 分钟自动断开连接

Android应用安全之JNI混淆

unity发布 webgl在手机端 inputfield唤醒键盘输入

Mathematical principle derivation of structured light phase shift method + multifrequency heterodyne

吐血推荐17个提升开发效率的“轮子”
随机推荐
[C language] use of file read / write function
杰理之wif 干扰蓝牙【篇】
Ugui force refresh of layout components
[source code + code comments] error state Kalman filter, extended Kalman filter, gps+imu fusion, EKF eskf gps+imu
[C language] about scanf() and scanf_ Some problems of s()
Is there a threshold for opening futures accounts? How to open futures accounts safely on the Internet
最新汇总!30省份公布2022高考分数线
ByteV搭建动态数字孪生网络安全平台----助力网络安全发展
【Unity编辑器扩展基础】、GUI
newest! Introduction and practical tutorial of point cloud processing based on open3d
Mr. Zhang responded to the first live broadcast with goods
websocket 1 分钟自动断开连接
【vi/vim】基本使用及命令汇总
【编解码】从零开始写H264解码器(1) 总纲
什么是泛型,怎么使用泛型分析
Ugui uses tips (VI) unity to realize vertical line display of string
UGUI使用小技巧(五) Scroll Rect组件的使用
ASP.NET CORE Study09
KDD 2022 | 图“预训练、提示、微调”范式下的图神经网络泛化框架
EMC RS485接口EMC电路设计方案