说说如何使用unity Vs来进行断点调试

15 篇文章 0 订阅

大家可以从这下载最新版的unity vs。 UnityVs1.81下载 
  
1.   安装unity vs。首先我们打开我们下载的unity vs。然后就会看见里面有3个文件,我们双击UnityVS 2013-1.8.1.msi。进行安装,在其过程狂点击下一步就可以,直到点击finish。安装完成。 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋
2.      我们先找到你安装visual studio 2012或者visual studio 2013的目录。
(****\Microsoft Visual Studio12.0\Common7\IDE\Extensions\SyntaxTree\UnityVS) 。
例如我是安装在
D:\ProgramFiles(x86)\MicrosoftVisualStudio12.0\Common7\IDE\Extensions\SyntaxTree\UnityVS
3.     从我们刚下载的unity vs里面,找到SyntaxTree.VisualStudio.Packages.dll。(上面所说的3个文件的其中一个)。 
然后把这个文件粘贴在步骤2中的.....\UnityVS文件夹中。 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋
4. 然后我们打开unity,新建一个工程。然后我们右键导入一个unity vs2013这个包(如果你以上操作都正确的话就能在右键后看见unity vs 2013这个包) 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋     
6 .然后我们修改下打开脚本的方式(其实这一般安装正确后会自动选择unityvs 2013去打开的这里我说下手动改变方式)。 
打开Edit----Preferences,选中External Tools ,选择其unityvs OpenFile 。如图: 
              说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋        说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋 
5.    然后新建一个脚本,我这取名为DebugTest.cs。来说明如何使用unity vs来断点调试。 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋 
6. 当我们双击的打开脚本的时候会弹出一个提示框,如下: 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋 
7. 我们打开刚才下载的,还记得我上面强调有3个文件吧,好了,我们打开key.txt。 
然后全选复制其内容,把它粘贴上去,点击ok,稍等片刻,就可以了。如图: 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋
8. 我们现在可以写脚本了,我在DebugTest.cs写的内容很简单,就是测试从1+...10。  内容如下: 
using UnityEngine; using System.Collections; public class DebugTest : MonoBehaviour 
{ private int sum = 0; void OnGUI() 
    { if (GUILayout.Button("Add")) 
        { for (int i = 1; i < 10; i++) 
            { 
                sum += i; 
            } 
            Debug.Log("1+2+3+...+10=" + sum); 
        } if (GUILayout.Button("Clear")) 
        { 
            sum = 0; 
        } 
    } 

  
9.我们把脚本拖个Main Camera . 好了 ,我们来随便加个断点吧,如图: 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋 
10. 我们可以开始断点测试了(有可能或弹出要你输入license ,那就要再次把我们的key给粘贴进去)。点击vs的启动,如图: 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋
  
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋
11.可以看见我启动成功了。然后我们回到unty 中,开始运行程序,当我们点击Add按钮后,程序运行到了我们断点处就停在那了。好了,时间不早了,我该休息了,明天还要7点起来上班了。 能力有限,出错难免,还望大家多多指点! 
说说如何使用unity Vs来进行断点调试 - 踏浪星空 - 踏浪的编程小屋

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
请看安装明安装 很难的的工具 1. If you have previously installed UnityVS uninstall it now, run ccleaner to remove any left over files & registry keys and reboot. 2. Run UnityVS 2012.msi to install UnityVS 3. Run "make Dir.bat" as ADMINISTRATOR, if you see any errors then make sure you have admin rights and run it again. 4. Right click "copy rhino.bat" and choose edit to open it in notepad 5. replace PATH_TO_THIS_DIRECTORY with the directory which you extracted the .bat and "Rhino.Licensing.dll" to. You should end up with something that looks like this 'copy "D:\extracted\Rhino.Licensing.dll" "%SystemRoot%\assembly\GAC_MSIL\Rhino.Licensing\1.2.0.0__0b3305902db7183f"' 6. Save the edit .bat and run it as ADMINISTRATOR, if you get any errors check the file again and make sure it saved correctly. 7. Navigate to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\SyntaxTree\UnityVS" and DELETE the "Rhino.Licensing.dll" File (it should ask you for admin rights to do this) 8. Now move (Cut & paste) the "log4net.dll" file from the current UnityVS Directory to the Visual Studio IDE directory (Go up 3 Directories - "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE") 9. Launch Visual Studio 2012 (If you get any errors from visual studio at this point or after make sure you've followed every step correctly, if you have uninstall UnityVs, uninstall visual studio 2012, run ccleaner for both temp files and the registry then reboot and start again) 10. It should now prompt you for your key, open up the key.txt extracted earlier and copy the contents into the box, it should now enable the OK button, click that and you're done! 11.If you still have errors after installing the crack try changing "1.2.0.0__0b3305902db7183f" to "1.2.0.0__49e34be443e62e2a" in both the make dir.bat and copy rhino.bat files and run them again.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值