Unity小Tip(持续更新)

一、隐藏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', () => {
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值