Skip to content

Commit e76a7aa

Browse files
committed
Add README
1 parent 1dbd527 commit e76a7aa

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ScriptLoader for BepInEx 5
2+
3+
This is a BepInEx 5 plugin that allows you to run C# script files without compiling them to a DLL.
4+
5+
This plugin uses a modified version of the Mono Compiler Service (mcs) that allows to use most of C# 7 features.
6+
The compiler relies on `System.Reflection.Emit` being present! As such, Unity games using .NET Standard API (i.e. has `netstandard.dll` in the `Managed` folder)
7+
will not be able to run this plugin!
8+
9+
## Installation
10+
11+
Download the latest plugin version from releases and place it into `BepInEx/plugin` folder.
12+
13+
## Writing and installing scripts
14+
15+
**To install scripts**, create a `scripts` folder in the game's root folder and place raw `.cs` files (C# source code) into it.
16+
**To remove scripts**, remove them from the `scripts` folder (or change file extension to `.cs.off`).
17+
18+
ScriptLoader will automatically load and compile all C# source code files it finds in the folder.
19+
ScriptLoader will also automatically run any `static void Main()` methods it finds.
20+
21+
Example script:
22+
23+
```csharp
24+
using UnityEngine;
25+
26+
public static class MyScript {
27+
public static void Main() {
28+
Debug.Log("Hello, world!");
29+
}
30+
}
31+
```
32+
33+
## TODO
34+
35+
* [] Script reloading
36+
* [] Specifying script metadata (name, description, DLL dependencies)
37+
* [] Maybe a UI?
38+
* [] Optionally an ability to locate and use `csc` to compile scripts when mcs cannot be used

0 commit comments

Comments
 (0)