1. 程式人生 > 其它 >Linux下安裝Unity3d時可能會遇到的問題,以及解決方案

Linux下安裝Unity3d時可能會遇到的問題,以及解決方案

未經許可禁止轉載,不製造網際網路垃圾,從你我做起

本人Linux環境:Mint Linux 21

從Unity官方源下載unity

官方文件

Debian or Ubuntu

Installing:

To install the Unity Hub on a Debian or Ubuntu Linux distribution, you need to add the Unity Hub Debian repository along with the public signing key to verify the integrity of the packages.

To add the Unity Hub repository, you need an entry in /etc/apt/sources.list

.

Run the following command to add the Unity Hub repository:

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

To add the public signing key, run the following command:

$ wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -

Then update the package cache and install the package using:

$ sudo apt update
$ sudo apt-get install unityhub
Uninstalling the Hub:

To remove the Unity Hub from the system, run the following command:

$ sudo apt-get remove unityhub

UnityHub無法啟動,如何安裝UnityHub的openssl依賴

在啟動UnityHub時,在有些Linux發行版上,UnityHub會卡在轉圈的介面,這是因為缺少一個依賴,如果在終端中啟動unityhub,會看到如下報錯

ERROR: Licensing SDK logging callback is not registered. 
Please use 'registerLoggingAdapter' function from the SDK to do so.

在論壇中有人貼出瞭解決辦法,原帖連結第20樓

Got the same error after upgrading to Ubuntu 22
Installing openssl 1.1 did not work for me
Installing libssl1.1 did work -
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb

libssl1.1安裝完畢後重啟電腦,如果不出意外,unityhub就可以使用了

如果還是不能使用那我也沒辦法,願偉大的開源之神保佑這個被Bug折磨的可憐孩子


VSCode中,沒有Unity程式碼提示

Tips:預設讀者已經做了以下幾件事情

  1. 在UnityEditor中,在External Tools中選中了VSCode作為程式碼編輯器
  2. 安裝了VSCode的C#拓展
  3. 安裝了最新的dotnet-sdk(老版本沒嘗試過,本人使用的是dotnet-6.0-sdk)
  4. 安裝了mono

原帖中,給出的解決辦法是在C#拓展中搜索設定Use Globle Mono,並將引數修改為always

但如果你用的是最新版本的C#拓展,那麼是沒有這個選項的

我的解決辦法是,將C#拓展降級到一年前的版本,這樣就可以找到這個選項

降級方法:

在外掛選單點選C#拓展右下角小齒輪,選擇安裝另一個版本,找到一個有著Use Globle Mono設定的版本