Unity
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
功能
显示当前激活的 Unity 和 C# 版本。
无论是否找到对应的C#版本,Unity版本都会显示。C#版本的确定流程是:首先检查静态表。如果静态表中未找到该Unity版本,则向Unity文档发起网络请求尝试提取版本信息。网络请求仅在首次遇到特定major.minor版本号的Unity时触发,后续调用将直接返回缓存的C#版本。
仅支持从 Unity 2017.1 开始的 C# 版本显示。
Unity 2017.1 - 2019.1 支持两个 C# 版本,具体取决于 Player Settings 中选择的脚本运行时。 本段始终选择较高版本。
示例配置
- json
- yaml
- toml
{
"type": "unity",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#111111",
"background": "#ffffff",
"options": {
"http_timeout": 2000
}
}
type: unity
style: powerline
powerline_symbol:
foreground: "#111111"
background: "#ffffff"
options:
http_timeout: 2000
type = "unity"
style = "powerline"
powerline_symbol = ""
foreground = "#111111"
background = "#ffffff"
[options]
http_timeout = 2000
选项
| Name | Type | Default | Description |
|---|---|---|---|
http_timeout | int | 2000 | in milliseconds - the timeout for http request |
模板 (信息)
默认模板
\ue721 {{ .UnityVersion }}{{ if .CSharpVersion }} {{ .CSharpVersion }}{{ end }}
属性
| Name | Type | Description |
|---|---|---|
.UnityVersion | string | the Unity version |
.CSharpVersion | string | the C# version |