一、隐藏unity启动logo
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Scripting;
/// <summary>
/// 不显示unity启动logo
/// </summary>
[Preserve]//特性,防止在打包的时候这个脚本 没有被打包进程序
public class StopVray
{
//在启动画面显示之前执行这个方法
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
private static void Test()
{
Task.Run(() =>
{
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
});
}
}
二、WebGL中文输入
1、导入WebGLSupport 插件包 插件包地址:【免费】Unity-WebGLSupport资源-优快云文库
2、导入插件后将WebGLInput脚本添加到Input组件上
3、打包完成后修改打包后的index.html文件,添加以下函数到<script>。。。</script>中
function getFullscreenElement() {
return document.fullscreenElement //standard property
|| document.webkitFullscreenElement //safari/opera support
|| document.mozFullscreenElement //firefox support
|| document.msFullscreenElement; //ie/edge support
}
function toggleFullscreen() {
if (getFullscreenElement()) {
//console.log("FullScreen");
} else {
document.getElementById("unity-container").requestFullscreen().catch();
}
}
document.addEventListener('click', () => {