Unity Debugging Visual Studio

Posted By admin On 04.10.19

Unity keeps improving its debugging tools, but the things still can get very painful, especially for Android development when it comes to debugging. Recently, we. I want to debug a game I am running on an Android device. You want to perform Android device debugging in either MonoDevelop or Visual Studio. This could be because of the following: There are objects with script components on them that are missing their script reference. The game hits breakpoints when running in Unity.

Unity debug android visual studio usb

Editor's noteI haven't tested this myself and I don't know whether it works with Unity 5.x. (. ) 17:50, 30 August 2015 (UTC)This tutorial discusses how to debug Unity shaders with Microsoft Visual Studio.Preparations. Update your software:.

Download and install the DirectX SDK (June 2010). Install the latest Windows Update. Install Visual Studio 2015 (or higher) with the latest update. This is important because the updates often fix graphics debugging related bugs.

Install Visual C for VS2015. Note that in Visual Studio 2015, Visual C is not installed by default. When installing, be sure to choose Custom installation and then choose the C components you require. Or, if Visual Studio is already installed, choose File New Project C and you will be prompted to install the necessary components, or run the installer again. More information:Example. Create a new project in Unity.

From the main menu select Create 3D Object Cube. In the Project window, right click and select Create-Shader-Standard Surface Shader. Leave the name as NewSurfaceShader.

Open the NewSurfaceShader.shader file and add this line after 'CGPROGRAM'. #pragma enabled3d11debugsymbols. In the Project View, select Create Material. Select the new material and go to Inspector-Shader-Select Custom/NewSurfaceShader. Drag the new material onto the cube. Go to File-Build Settings-Select PC Standalone, then click Switch Platform (if not already).

From the main menu, select Edit Project Settings Quality. In the Inspector View disable anti aliasing for all quality levels. Save the project. From the main menu, select File Build Settings. Tick the box 'Development Build' and 'Script Debugging'.

From the main menu, select Edit Project Settings Player. In the Inspector View select Resolution and Presentation Standalone Player Options Display Resolution Dialog Disabled.

Select Player Settings-Inspector-Other Settings. Untick 'Auto Graphics API for Windows' and check that Direct3D11 is at the top of the list. Also check if the Unity Editor title bar states '. From the main menu, select File Build & Run, name the file test.exe, and click Save. Note the path to the executable. Create a new project in Visual Studio 2015.File-New-Project-Installed-Templates-Other Languages-Visual C-Empty Project.Note: if Visual C is not available, follow the instructions at the 'Update Software' section above.

Select a name and location for the project and click Ok. Go to View Solution Explorer. Select the project (the project, not the solution). Go to Project Properties Configuration Properties Debugging.Note: if Debugging is not available in the Configuration Properties, you selected the solution instead of the project in the Solution Explorer, or you created a C# instead of a C project. In the Command field, replace '$(TargetPath)' with the path to the Windows executable you built earlier.

Unity

In the Command Arguments field, add '-force-d3d11'. Click OK. Select Build Build Solution. Go to Debug Graphics Start Diagnostics. Install the Graphics Tools if a popup shows up.

Unity 2018 Visual Studio

The standalone build should fire up and this message should appear in the top left: 'Frames captured: 0. Use Print Screen key to capture a frame'. Press the Print Screen key. Alt-Tab out of the standalone build and go to Visual Studio.

Visual Studio Download

Unity Debugging Visual Studio

Note: to close the Unity test app, select ALT-F4. You should see a frame capture in Visual Studio. Double your captured frame and a new Visual Studio window should open. On the new Visual Studio window, Place the crosshair on the pixel of interest and left click.