Skip to content

Commit 2e5d7fe

Browse files
committed
2 parents 226a04c + 12ea3fe commit 2e5d7fe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
# Unity Netcode Patcher
34
**This is an assembly patcher which replicates the IL Post Processing that unity does with it's Netcode For Gameobjects Package, allowing you to create custom NetworkBehaviours in mods as if you were doing it in a Unity project.**
45

@@ -13,8 +14,10 @@
1314
1. Download the latest release from [Releases](https://github.com/EvaisaDev/UnityNetcodeWeaver/releases)
1415
2. Move NetcodePatcher folder from the zip into any location, I will have it in `O:/NetcodePatcher` for this tutorial.
1516
3. Move contents of `GameFolder/GameName_Data/Managed` into `NetcodePatcher/deps`
16-
4. Add the following snippet to your mod, in a place where it will only run once, such as `Awake()`
17-
- **It is very important that it only runs once!**
17+
18+
## Preparing mods for patching
19+
To ensure that the patched NetworkBehaviours are initialized properly, add the following code snippet to your mod, in a place where it will only run once, such as `Awake()`
20+
- **It is very important that it only runs once!**
1821
```cs
1922
var types = Assembly.GetExecutingAssembly().GetTypes();
2023
foreach (var type in types)
@@ -29,7 +32,7 @@
2932
}
3033
}
3134
}
32-
```
35+
```
3336

3437
## Usage from command line
3538

@@ -44,11 +47,8 @@
4447

4548
Example post build event:
4649
```
47-
xcopy "$(TargetPath)" "O:\NetcodePatcher\plugins\LethalThings" /Y
48-
xcopy "$(TargetDir)$(AssemblyName).pdb" "O:\NetcodePatcher\plugins\LethalThings" /Y
4950
cd O:\NetcodePatcher
50-
NetcodePatcher.dll plugins/ deps/
51-
xcopy "O:\NetcodePatcher\plugins\LethalThings\$(AssemblyName).dll" "C:\Program Files (x86)\Steam\steamapps\common\Lethal Company\BepInEx\plugins\LethalThings" /Y
51+
NetcodePatcher.dll $(TargetDir) deps/
5252
```
5353
Essentially what it is doing is copying the assembly and the pdb file from the output folder, and running the patcher.
5454
Then copying the patched assembly to the plugins folder.

0 commit comments

Comments
 (0)