【问题标题】:Turn on unity code snippets in Visual Studio在 Visual Studio 中打开统一代码片段
【发布时间】:2019-07-22 12:23:31
【问题描述】:

我已经安装了 Unity、VS-2019、Net4.x。

毕竟,当我写“Rig...”时,Intellisense 知道我的意思是 RigidBody,但它不会像 OnTriggerExit() 甚至 Start() 和 Update() 这样的自动完成方法。 如何启用它?

我在 unity 首选项 net4.x 中指定了 VS 可执行文件,并多次重新加载了 unity 和 VS。

public class SomeScript : MonoBehaviour 
{
    private Rigidbody rb;
    void Start ()
    {
        this.rb = GetComponent<Rigidbody>();
        //this line autocompleted well
    }

    void OnTrigger... // doesn't autocomplete
}

【问题讨论】:

  • 您使用的是哪个 Unity 版本? VS2019 不完全支持某些旧版本

标签: c# visual-studio unity3d intellisense code-snippets


【解决方案1】:

有时这是由于 Unity 和 VS 版本不兼容造成的。因此,请确保将 Unity2019 与 VS2019 一起使用,并将它们更新到最新版本。

检查Unity中的external tools setting,确保里面的external script editor设置为对应的VS版本。 (根据您的情况选择VS2019)

然后您可以在解决方案资源管理器中检查卸载并重新加载项目后是否仍然存在此问题。

另外,我建议您可以按照this similar issue 的详细步骤进行故障排除并解决此问题。希望对你有帮助:)

【讨论】:

    猜你喜欢
    • 2020-09-07
    • 2016-11-17
    • 2011-07-05
    • 1970-01-01
    • 2022-11-27
    • 1970-01-01
    • 1970-01-01
    • 2016-02-20
    相关资源
    最近更新 更多