Mod Details

UnityToolkit

UnityToolkit 2.0.1

Created by  Arys

207.6K Downloads

SPT 4.0.3 Compatible

A collection of Unity libraries for client modders to make writing efficient, allocation-free code easier.

Latest Version 2.0.1
SPT 4.0.3

Updated Oct 25, 8:49 PM

489.02 KB

Version Notes

In this release

  • Removed redundant code
  • Removed FixPluginTypesSerialization
    • Unfortunately this plugin caused conflicts with some other mods so the decision was made to remove it
This download is externally hosted.
Always scan for viruses.

UnityToolkit

What is this library for?

This library aims to provide additional tools to client modders which will (hopefully) allow them to write more optimised code and reduce the performance cost and memory allocation of their code even further.

How to install this library (for users)

  1. Download the latest release
  2. Open the .7z with 7-Zip
  3. Drag and drop the ‘BepInEx’ folder into your game folder
  4. Play SPT

How to use this library (for mod developers):

  1. Download the latest release
  2. Copy the assemblies from the release zip to where you store your project’s assembly references
  3. Add all the assemblies as assembly references to your project
  4. Add [BepInDependency("com.arys.unitytoolkit")] attribute to your plugin class (I recommend you add a minimum version string to the attribute)
  5. You can now use UniTask, Unity.Collections, VContainer, ZLinq and ZString in your mod

What features does this library provide?

  1. UniTask is a near zero-allocating, performant version of C# Tasks that’s suited for Unity than the standard C# implementation
    • It doesn’t use threads or SynchronizationContext/ExecutionContext so the result is faster performance and lower allocation while matching Unity threading (single-thread)
    • It is also possible to replace Unity’s Coroutines, which has poor performance and higher memory allocation, with UniTask instead
    • Documentation: https://github.com/Cysharp/UniTask
  2. Unity.Collections is included in this library for the additional NativeContainer types it provides
  3. VContainer is a fast Dependency Injection container, designed for Unity and works with injecting into both standard C# classes and Unity MonoBehaviours
  4. ZLinq provides high performance, zero-allocation LINQ by utilising ValueEnumerable, made by the developer of UniTask
  5. ZString is a near zero-allocating string builder, which is also made by the developer of UniTask and ZLinq

Also included:

  • FixPluginTypesSerialization is a patcher that fixes custom classes/structs with the [System.Serializable] attribute not being deserialized properly for BepInEx plugins
    • Thanks to Tarkin for discovering this bug and the fix

Is it safe?

Yes, all assemblies are just compiled versions of their original git repo I’ve also included a VirusTotal scan of all assemblies on the GitHub releases page

Building from source

  1. Clone the repository:
    git clone https://github.com/Nympfonic/UnityToolkit.git
    
  2. Place the compiled assemblies for UniTask, Unity.Collections and ZString in project\UnityToolkit\References.
  3. Adjust the reference paths, macros and build events in the .csproj files
  4. Open solution in your preferred C# IDE
  5. Build solution
Version 2.0.1
Download Mod Version
SPT 4.0.3
Latest Compatible SPT Version

489.02 KB

542 Downloads

Created Oct 25, 8:48 PM

Updated Oct 25, 8:49 PM

Virus Total Results

In this release

  • Removed redundant code
  • Removed FixPluginTypesSerialization
    • Unfortunately this plugin caused conflicts with some other mods so the decision was made to remove it
Version 2.0.0
Download Mod Version
SPT 4.0.3
Latest Compatible SPT Version

519.99 KB

286 Downloads

Created Oct 22, 6:54 PM

Updated Oct 23, 8:38 AM

Virus Total Results

WARNING

There is an issue with this release which causes the game to fail to load into the main menu with certain mods installed.

Please remove the “FixPluginTypeSerialization” folder inside the “BepInEx/patchers” folder!

After discussion with Tarkin, this patcher will be removed in the next update of UnityToolkit and he will provide a fixed version of that patcher in his upcoming mod.

In this release

  • Removed all APIs and extension methods
    • They were not up to par and were probably only used by myself
  • Added VContainer
    • A fast dependency injection container designed for Unity, so it also works on injecting into Unity Objects
  • Added ZLinq
    • Adds high performance, zero-allocation LINQ by using ValueEnumerable
  • Added FixPluginTypesSerialization
    • Fixes a bug that affects all Unity Engine versions where references to custom [System.Serializable] classes/structs would not be deserialized correctly in Unity Objects added by client mods
    • Thanks to Tarkin for finding this fix
Version 1.2.0
Download Mod Version
SPT 3.10.5
Latest Compatible SPT Version

33.0K Downloads

Created Feb 21, 11:28 PM

Updated Feb 21, 11:28 PM

Virus Total Results

Added Dependency Injection Container and Event Bus structures for mod developers

Version 1.1.0
Download Mod Version
Unknown SPT Version
Latest Compatible SPT Version

26.4K Downloads

Created Jan 11, 12:37 AM

Updated Jan 11, 12:37 AM

Virus Total Results

New in this release

  • Fixed issue where UniTask’s PlayerLoopSystem was not being injected correctly
  • Updated UniTask from v2.5.5 to v2.5.10
  • Added ZString v2.4.4 as a near zero-allocation string builder alternative
  • Added new structures: Closure<TContext>, ObjectPool<T>, and IProcessor<TProcessor, TData>
  • Added a new ModulePatchManager class which can be used in your client mod plugin to automatically enable your mod patches

See details in the release notes: https://github.com/Nympfonic/UnityToolkit/releases/tag/v1.1.0

Version 1.0.1
Download Mod Version
Unknown SPT Version
Latest Compatible SPT Version

144.7K Downloads

Created Jul 8, 2024 at 2:39 AM

Updated Jul 8, 2024 at 2:39 AM

Virus Total Results

Updated UniTask from v2.5.4 to v2.5.5

Version 1.0.0
Download Mod Version
Unknown SPT Version
Latest Compatible SPT Version

2.7K Downloads

Created May 20, 2024 at 9:40 PM

Updated May 20, 2024 at 9:40 PM

Virus Total Results

Initial release

Arys * Pinned

WARNING

There is an issue with v2.0.0 release which causes the game to fail to load into the main menu with certain mods installed.

Solution: Please delete the “FixPluginTypesSerialization” folder inside the “BepInEx/patchers” folder.

After following the above solution, you may also update to v2.0.1

Sorry for the inconvenience!

0 Likes
selyue

挖矿.exe restart the server ? is that a joke ?

0 Likes
morklose

omg update for 4.0 spt, im dreaming?

0 Likes
debil228

Is there any way to use this mod on 3.11? I need him urgently. Maybe just replace some number in the file?

0 Likes
Polarius

As of now causes infinite Loading. (3.11)

Just wanted to say.

1 Like

Yes, this version of Tarkov updated to Unity Engine 2022 which means this mod is not compatible.
No plans to update since I’m on hiatus from SPT for the time being.

5 Likes

Damn that is sad to hear, i hope that there will be a workaround for FriendlyPMC’s then because it has this listed as a dependenciy

btw. wish you a good hiatus.

1 Like
Steven P

Spt 3.9.5 is telling me it can’t find the unityplayer.dll, it is in the bepinex folder, is that where it belongs?

0 Likes
elliottnally

Does the UnityToolkit 1.0.1 work with 3.8.3 still?

1 Like
Arys

This mod (across all versions) will always work on any version of SPT, so yes.

However it’s best to ask the original mod dev what version they used. I cannot guarantee that future versions are backwards compatible if they referenced an older version of this library.

1 Like

Details