Question

How to add IntelliSense and Syntax Highlighting to Visual Studio 2013 when I call it from Unity3d?

Now I have a code:

using UnityEngine;
using System.Collections;

public class cubeScript : MonoBehaviour
{
    // Use this for initialization
    void Start ()
    {

    }

    // Update is called once per frame
    void Update ()
    {
        if (Input.GetKeyDown(KeyCode.R))
            gameObject.renderer.material.color = Color.red;
        else if (Input.GetKeyDown(KeyCode.B))
            gameObject.renderer.material.color = Color.blue;
        if (Input.GetKeyDown(KeyCode.G))
            gameObject.renderer.material.color = Color.green;
    }
}

.. and it is all black

Was it helpful?

Solution

I'm assuming you've seen this documentation about how to properly use Visual Studio with Unity C#: http://docs.unity3d.com/Documentation/Manual/VisualStudioIntegration.html

Verify if you're using VS Express or Professional.

My only suggestion would be to retry those steps for your project, or look into acquiring UnityVS. UnityVS is an asset package that you import into your Unity project, and it allows you to use Visual Studio's Debugger with Unity.

Alternatively, Sublime Text Editor has beautiful syntax highlighting for Unity C#, but does not compile or debug your code.

Best of luck.

OTHER TIPS

This question is rather old, but with the release of Unity 5 you can now use a full-featured version of Visual Studio for free.

I made a tutorial about it here (the first 3 minutes go over setting up; then it goes into a brief bit about debugging).

Essentially you can download VS2015 Community (for free) and use it with Visual Studio Tools for Unity.

Unity 5 comes with the VS Tools when you install it, so no manual installation needed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top