Optimizations Module #4 of 6
Debugging
Debugging in Visual Studio Open Unity exported solution in VS Open .cs file in your project ( no need to add them, just open) Set break points Debug as usual
Remote debugging (Windows RT) Deploy Windows RT remote debugging tools Select Remote Machine as Target Configure remote machine connection Debug as usual
Uninstall & re-install for Unity When installing a new build: Run “uninstall” Delete the old directory (just in case) Known issues: Mono Assemblies left in GAC can cause issues (e.g. Cecil)
Unity Symbols Unity Editor includes Target platforms Debug Master Windows Phone 8 (x86,ARM) Windows Store 8 (x86,ARM) Windows Store 8.1 and Universal (x86,ARM)
Performance tips.. Avoid interop.. Poll as little as possible.. Use event handlers when possible Understand your GPU capabilities Optimize for display size/resolution Watch your memory
Performance tools Unity Profiler works on Windows Phone & Windows Visual Studio Graphics Diagnostics Windows Phone Developer Power Tools Windows Performance Recorder Windows Performance Toolkit http://channel9.msdn.com/Events/Build/2014/4-557
Frames/sec counter Per DX Call Replay Graphics Pipeline Stages Frame capture
Logs (Windows Phone) Editor.log UnityPlayer.log Crash dumps Located at %LOCALAPPDATA%\Unity\Editor\Editor.log UnityPlayer.log Located in App’s data folder Use Windows Phone power tools to view Crash dumps Located at <device>\Phone\Documents\Debug folder on phone Connect phone via USB and use Windows Explorer
Logs (Windows) Editor.log UnityPlayer.log Crash dumps Located at %LOCALAPPDATA%\Unity\Editor\Editor.log UnityPlayer.log Located in App’s data folder Elevate and look under c:\program files\windowsapps\<yourapp> Crash dumps %LOCALAPPDATA%\CrashDumps or use HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps
Visual Studio Tools for Unity (UnityVS) Features Debugging Code Editor Project Explorer Unity console redirect Visual Studio Pro SKU VS 2010 VS 2012 VS 2013 http://visualstudiogallery.msdn.Microsoft.com
Summary When targeting Windows and Windows Phone with Unity, you get the richness of Windows development