Skip to content

Commit 90857dc

Browse files
committed
readme
1 parent b49f2fa commit 90857dc

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.markdown

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## UnityAssemblyInjector
2+
This library is used for loading custom c# assemblies into Unity games' runtime without having to modify any game files.
3+
4+
5+
## How to use
6+
Place the dll file next to the game's main directory, if it's a 32bit unity game, use version-x86.dll, otherwise, use version-x64.dll (rename to version.dll in either case)
7+
8+
Create an assemblies.txt which will contain the path to your c# dlls and a static entry point path, i.e. `SomeMod\\SomeLoader.dll=SomeNamespace.SomeClass:StaticInitMethod`. you can have as many of these as you want, one per line.
9+
10+
The basic structure of the c# project would be as such
11+
```csharp
12+
namespace SomeNamespace
13+
{
14+
public class SomeClass
15+
{
16+
public static void StaticInitMethod()
17+
{
18+
new Thread(() =>
19+
{
20+
Thread.Sleep(5000); // 5 second sleep as initialization occurs *really* early
21+
22+
GameObject someObject = new GameObject();
23+
someObject.AddComponent<SomeComponent>(); // MonoBehaviour
24+
UnityEngine.Object.DontDestroyOnLoad(someObject);
25+
26+
}).Start();
27+
}
28+
}
29+
}
30+
```
31+
32+
## Downloads
33+
Downloads can be found in the [releases](https://github.com/avail/UnityAssemblyInjector/releases) tab.

0 commit comments

Comments
 (0)