- 2017.7.13 更新支持
.lua.txt
語法高亮
windows
需要安裝
Microsoft .NET Core
Microsoft .NET Framework 3.5 SP1
ps: .NET Framework 3.5
安裝時需要保證 window update 開啟锥惋。否則更新不成功。window10 下開啟 window update 方法:按 WIN + r
打開運(yùn)行稻励,輸入 services.msc
回車轩娶。找到 “Windows update”。
OSX
需要安裝
Mono 跨平臺的 .NET 框架沙廉。
homebrew: 打開終端執(zhí)行 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
dotnet cli
ps: 后來發(fā)現(xiàn)安裝 homebrew 是為了更好地安裝 dotnet cli憨颠。
通用
使用 VSCode 寫 Unity 時氮趋,需要為 每一個 unity 項(xiàng)目單獨(dú)配置一下辜御,在項(xiàng)目的 Assets
目錄下新建 Plugins/Editor
文件夾鸭你,將下載的 VSCode.cs 腳本文件放到這個目錄下。重啟一下 Unity擒权。在 Preferences...
中(OSX 下的 Unity 選項(xiàng)卡袱巨,Windows 下的Edit選項(xiàng)卡)。
勾選六項(xiàng)碳抄。再次開啟 unity 時就會自動啟動 VSCode愉老。根據(jù) VSCode 控制臺的(報錯)信息 。去下載上方提到的幾種前置纳鼎。
支持 .lua.txt
- 安裝 lua 擴(kuò)展
- 在設(shè)置中添加配置項(xiàng)
// 首選項(xiàng) - 設(shè)置 - settings.json
{
// ...
"files.associations": {
"*.lua.txt": "lua"
}
}
windows 如果雙擊文件不打開 vscode俺夕,嘗試勾選掉 Unity Preferences/VSCode 中的 enable Integration
插件
- C#:VSCode 下的 C# 語法支持
- Unity Snippets: 提供一些語法片段
- C# Extensions: 語法快捷擴(kuò)展
設(shè)置
// settings.json
{
"editor.fontSize": 18,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.minimap.enabled": true,
"editor.rulers": [ 80, 100 ],
// "editor.renderWhitespace": "boundary",
"files.autoGuessEncoding": true,
"files.autoSave": "onWindowChange",
"files.defaultLanguage": "zh-cn",
"markdown.preview.fontSize": 18,
"extensions.autoUpdate": true,
"workbench.colorTheme": "Material Theme",
"workbench.iconTheme": "vs-seti"
}
## 異常問題
1. 編輯器啟動報錯:OmniSharp.MSBuild.ProjectFile.ProjectFileInfo The reference assemblies for framework ".NETFramework,Version=v2.0" were not found.
電腦中包含多個版本的 mono
解決方案:`brew unlink mono; brew link mono`裳凸,
慘嚎鏈接:https://github.com/OmniSharp/omnisharp-vscode/issues/1004