当前位置:网站首页>Ilruntime hotfix framework installation and breakpoint debugging

Ilruntime hotfix framework installation and breakpoint debugging

2022-06-10 23:45:00 Wangyuanjun

Official website :

https://ourpalm.github.io/ILRuntime/public/v1/guide/tutorial.html
https://github.com/Ourpalm/ILRuntime

1. use Unity built-in PackageManager Search for "ILRuntime"
1.1 There is :

direct “install”

1.2 non-existent

First of all, the Packages/manifest.json in , add to ILRuntime Source information for , In this file dependencies Add the following code before the node

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

Pictured :
 Insert picture description here

And then through Unity Of Window->Package Manager menu , open Package Manager, Select the upper tab option as All Packages,Advanced On the inside Show Preview Packages, wait for Unity After loading package information , You should be able to find... In the list on the left ILRuntime, Click Install

1.3 Still can't install :

part Unity The version cannot be directly displayed in the list ILRuntime, If the list on the left is missing , That's at the end of the project manifest.json Medium dependencies Beginning of paragraph , Add the following code to manually ILRuntime Add to project
“com.ourpalm.ilruntime”: “1.6.0”,

Pictured :
 Insert picture description here

1.4 You can import Demo

ILRuntime After the package is installed , stay Package Manager Choose ILRuntime, On the right detailed page, there are Samples, Click... On the right Import to project Can be ILRuntime An example of Demo Import the current project directly .

1.5 Import Demo Report errors

After the example is imported into the project, it may not be started unsafe Cause compilation error , Can be in PlayerSettings The admission Allow unsafe code Resolve compilation issues .

1.6 Turn on hot change DLL engineering

stay Assets\Samples\ILRuntime\1.6\Demo\HotFix_Project~ Open hotter in the directory DLL Of vs engineering , Compile directly , Then it can run normally ILRuntime Of Demo An example

1.7 Final solution
If you still can't find it after the above configuration ILRuntime, You can follow the following Unity3D The steps of the sample project are manual installation ILRuntime

· ILRuntime Install and debug plug-ins
One . official gitHub Download plug-ins Be careful VS edition

1. Address :https://github.com/Ourpalm/ILRuntime/releases
 Insert picture description here
Two . Plug in installation
1. close VS
2. open ILRuntimeDebuggerLauncher.vsix install

 Insert picture description here
3. Just follow the steps
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
OK The debugging plug-in has been installed

· ILRuntime Start debugging
One . For the convenience of debugging , Change the code first
1. When pressed F1 Print information when
HelloWorld Script , stay update Add the following code :

 if (Input.GetKeyDown(KeyCode.F1))
    OnHotFixLoaded();

2. When debugging plug-ins, you need to Unity Add... To the project appdomain.DebugService.StartDebugService(56000); This code , Among them appdomain Point to your hotfix assembly
 Insert picture description here
Two . Breaking point , function unity
1、 First run Untiy, Must have performed appdomain.DebugService.StartDebugService(56000) Code , To debug the breakpoint normally

2、 stay HotFix_Project Open the debug plug-in window in the project Debug( debugging )->Attach to ILRuntime
 Insert picture description here /3、 Fill the pop-up window with the name of the host being debugged IP Address and port of debugging server , Click on attach, Started debugging .
. Insert picture description here
4. Start debugging , stay unity Select the running Game Window press F1, Can follow the normal VS Same as debugging
 Insert picture description here
Generate dll Location
If HotFix_Project The folder is not in the project , So the generated dll The document is still there StreamingAssets Next .
 Insert picture description here
Official documents https://ourpalm.github.io/ILRuntime/public/v1/guide/performance-optimization.html

原网站

版权声明
本文为[Wangyuanjun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206102221028471.html