Can somebody suggest me a good and light c# IoC container that works in Unity3D and does not rely on Service Locator pattern? Thank you!
Asked
Active
Viewed 4,821 times
10
-
1On what platform does Unity3D run? Is this .NET Compact Framework? Desktop framework? Silverlight? Silverlight for Windows Phone? Mono? Moonlight? And which version? – Steven Feb 09 '12 at 09:17
-
1Thanks for the interest, I assumed people would know what Unity3D is. honestly I am not still sure about how Unity3D handles c# code, what I am sure about is that it uses Mono and probably the compiler is a modified version of it (for example it has some limitation about the native code support). It does not support the entire .net framework, probably it is something similar to the compact one, but it is really one created on purpose for Unity3D. However I think that eventually I am going to use this as base of my custom IOC: http://stackoverflow.com/a/8973094/732761 – sebas Feb 09 '12 at 10:49
-
You can't understand something that doesn't exist; the description for the tag even assumes that there is something called "Unity3D". This is probably not the best place to get relevant answers. – Jun 07 '12 at 20:33
3 Answers
10
Eventually I did not find any working implementation of an IoC container made specifically for unity3D framework (http://unity3d.com/), so I decided to implement one on my own and I blogged about it here: http://blog.sebaslab.com/ioc-container-for-unity3d-part-1/

sebas
- 1,045
- 12
- 27
8
I know this thread is old, but if anyone comes along who's interested in an IoC solution for Unity3D, this open source project went live today: http://thirdmotion.github.io/strangeioc/

MarcT
- 178
- 1
- 5
-
I know this is not a constructive comment. But never the less I'm just going to say it. I'm in love with StrangeIoC. Strange has taught me a lot in terms of inversion of control (IoC), Dependancy injection (DI) and Bindings in general. If anyone is looking for a good MVCS structured IoC framework for unity, look no further. Strange is what you want. – hdsenevi Nov 17 '14 at 13:06
4
We rolled our own based on ideas from Sebastiano Mandalà, which you can find here: https://github.com/modesttree/Zenject

Steve Vermeulen
- 1,406
- 1
- 19
- 25
-
We ended up putting this in the asset store here: http://u3d.as/content/modest-tree-media/zenject-dependency-injection/7ER – Steve Vermeulen Jun 18 '14 at 01:10