You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -7,59 +7,71 @@ UniversalUnityHooks aims to bring a adaptable modding API to any unity game. Thi
7
7
## Code Example
8
8
9
9
```cs
10
-
publicclassprintStartPlugin
10
+
publicclassYourClass
11
11
{
12
-
[Hook("SvNetMan.StartServerNetwork")]
13
-
publicstaticvoidstartServerNetwork(SvNetManman)
12
+
[Hook("SvManager.StartServer")]
13
+
publicstaticvoidStartServer(SvManagerman)
14
14
{
15
15
Debug.Log("Plugin Loaded!");
16
16
}
17
-
18
17
}
19
18
```
20
19
21
-
In this example the game hooks the examples ServerStartNetwork method in the SvNetMan Class, and prints Plugin Loaded when the server connects to the network
20
+
In this example the game hooks the examples ``StartServer`` method in the ``SvManager`` Class, and prints Plugin Loaded when the server starts.
22
21
## Motivation
23
22
24
-
The inital motivation behind the project was to provide a way for server owners to develop plugins for the game Broke Protocol (https://brokeprotocol.com). But due to the way unity games are made, this program can be ported to any other game relatively easily
23
+
The inital motivation behind the project was to provide a way for server owners to develop plugins for the game Broke Protocol (https://brokeprotocol.com). But due to the way unity games are made, this program can be used on other games very easily.
25
24
26
25
## Installation
27
-
28
-
Assuming Linux (x64)
29
-
30
-
For windows:
31
-
32
-
* Build the files from Visual Studio or under Bash For Windows
Reference the .dll into your class library project. Make sure that the class that contains all the hooks is public as well as the hook methods themselfs.
29
+
Put your compiled DLLs in your ``root/Plugins`` folder. You may need to run ``UniversalUnityHooks.exe`` first to create that folder.
30
+
(Optional) I suggest adding this command to ``Post build event``: ``copy /Y "$(TargetFileName)" "..\..\..\..\Plugins\"``, assuming you keep your solution in ``root/Scripts``.
46
31
47
32
## API Reference
48
33
49
34
The program is fairly straight forward, to hook a method, simply put
50
35
`[Hook("Class.Method")]`
51
-
Then supply the instance as the first variable, and the rest of the variables as refs.
52
-
So if I were to want to modify Damageof the SvPlayer Class with variables DamageIndex, Amount, Attacker, and Collider, That would become
36
+
Then supply the instance as the first variable, and the rest of the variables as ``refs``.
37
+
So if I were to want to modify the ``Damage`` methid inside of the ``SvPlayer`` class with variables ``DamageIndex``, ``Amount``, ``Attacker`` and ``Collider``, that would become
0 commit comments