Zenject
Unity Playworks Plugin supports Zenject up to version 8.0.0.
Unity Playworks Plugin doesn't support DLL versions of plugins so it is required to include the C# source files inside your project.
This guide is for developers who are using Zenject in their Unity projects as DLLs.
- Download or clone the Zenject source code on GitHub.
- Move the Zenject source files located inside
Zenject-master > UnityProject > Assets > Plugins > Zenject
outsideZenject-master
.
- You will receive some console errors that need resolving but don't worry, these are caused by DLL usages requests within the plugin.
To clear the errors you will need to remove then replace
Zenject > Source > Usage
folder contents (containing the DLL) with the contents ofZenject-master > AssemblyBuild > Zenject-usage
with is the source files.
Remove the DLL usage:
Move the source usage
Once this is done you can remove the
Zenject-master
from your project. You can also removeoptionalExtras
from theZenject
folder.The final step will be an invisible build error caused in Luna. This error is caused by a specific script called
CachedProvider.cs
, and the pre-processor directives (#if
and#endif
), which can cause build errors in Luna.
To resolve the build compilation failure you should comment out all pre-processors from this script which will allow for a successful build.
Example:
List<object> _instance;
// #if ZEN_MULTITHREADING
readonly object _locker = new object();
// #else
bool _isCreatingInstance;
// #endif
You may need to restart Unity as some errors might be present due to cache.