2022年8月

直接从官网下载的deb安装后会出现问题,比如,hub界面打不开、无法创建证书,无法激活等问题

下载 OpenSSL 1.0

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb

安装

sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb

添加 Unity3D 存储库

sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'

添加公共签名密钥

wget -qO - https://hub.unity3d.com/linux/keys/public | sudo tee /etc/apt/trusted.gpg.d/unityhub.asc

安装 Unity Hub

sudo apt update
sudo apt install unityhub

卸载 Unity Hub

sudo apt remove unityhub

sendpix1.jpg
sendpix2.jpg

原文地址
https://dev.to/brenomfviana/installing-unity-hub-on-ubuntu-42l0

使用的是GLTFUtility https://github.com/Siccity/GLTFUtility.git
gltf样品库 https://github.com/KhronosGroup/glTF-Sample-Models.git
我的测试模型 https://www.xuefei.net.cn/unitywebgl/WaterBottle.glb
我的webgl测试地址 https://www.xuefei.net.cn/unitywebgl/index.html
主要代码

using System.Collections;
using UnityEngine;
using Siccity.GLTFUtility;
using UnityEngine.UI;
using UnityEngine.Networking;

public class GLTFTest : MonoBehaviour
{
    public Button button;
    public GameObject loadGo = null;

    // Start is called before the first frame update
    void Start()
    {
        button.onClick.AddListener(delegate
        {
            StartCoroutine(LoadGo());
        });
    }

    private IEnumerator LoadGo()
    {
        if (loadGo != null)
        {
            DestroyImmediate(loadGo);
            Resources.UnloadUnusedAssets();
        }
        var request = UnityWebRequest.Get("https://www.xuefei.net.cn/unitywebgl/WaterBottle.glb");
        yield return request.SendWebRequest();
        if (request.result != UnityWebRequest.Result.Success)
        {
            Debug.LogError(request.error);
        }
        else
        {
            Debug.Log(request.downloadHandler.text);
            loadGo = Importer.LoadFromBytes(request.downloadHandler.data);
        }
    }
}

效果图
20220731132356.png