Skip to content

avail/UnityAssemblyInjector

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

UnityAssemblyInjector

This library is used for loading custom c# assemblies into Unity games' runtime without having to modify any game files.

How to use

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)

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.

The basic structure of the c# project would be as such

namespace SomeNamespace
{
    public class SomeClass
    {
        public static void StaticInitMethod()
        {
            new Thread(() =>
            {
                Thread.Sleep(5000); // 5 second sleep as initialization occurs *really* early

                GameObject someObject = new GameObject();
                someObject.AddComponent<SomeComponent>(); // MonoBehaviour
                UnityEngine.Object.DontDestroyOnLoad(someObject);

            }).Start();
        }
    }
}

Downloads

Downloads can be found in the releases tab.

About

generic assembly injector for unity games - without requiring to modify any game files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages