安裝 ILRuntime 偵錯插件

修改 Packages/manifest.json, 在最後面添加下面內容

"scopedRegistries": [
  {
    "name": "ILRuntime",
    "url": "https://registry.npmjs.org",
    "scopes": [
      "com.ourpalm"
    ]
  }
],

回到 Unity 會自動彈出 ILRuntime

從這邊下載 VS Debugger 插件

雙擊安裝

安裝好了後在 Visual Studio 調試裡面會出現 Attach to ILRuntime , 另外 appdomain 必須添加下面功能才行

this.appDomain.LoadAssembly(this.dllStream, this.pdbStream, new Mono.Cecil.Pdb.PdbReaderProvider());
//開啟debug端口
this.appDomain.DebugService.StartDebugService(56000);

Last updated