Comments (6)
Thanks for reporting this - I'm going to try changing to use overloads instead
from zenject-2019.
Ok I updated the git repo to play nicely with monodevelop (using overloads). I'm not seeing your other error though about ambiguous reference. It might be fixed with the newer version of zenject (2.5)?
from zenject-2019.
The github version now compiles in MonoDevelop just fine.
But, the other error doesn't appear by default, you need to go to Project->Assembly-CSharp Options
in MonoDevelop, choose Build->General
and change Target Framework
to Mono/.Net 4.0 or above. I tried and it's still there. I couldn't be sure if this is really important, though. Probably not. But some people increase the framework version for different reasons (methods with default parameters is one of such reasons).
Also found another minor issue, with cursor visibiliy in GameController of sample game. You now probably need to check for UNITY_5
(or for both UNITY_5_0
and UNITY_5_1
). Otherwise, Unity automatically converts the code to:
#if UNITY_5_0
Cursor.visible = false;
#else
Cursor.visible = false;
#endif
Which is even already in the repo.
from zenject-2019.
Ah yes I see what you mean with the ambiguous errors now. I'm not sure if there's a way to fully address that since as you say there isn't defines you can #ifdef with for the .NET framework version as far as I know. The reason that I defined those custom versions of Func<> is because .NET 3.5 or less only defines Func<> up to four parameters, which is quite limiting. But if you are using a more recent version of .NET then you can just comment those out (I added a comment in Func.cs explaining this). I had to make a few other minor adjustments but after you do that it seems to compile fine with 4.0
As for the cursor visibility, I'm not sure what problem you are referring to. I noticed that the cursor is still visible in unity but when run as a standalone build it is correctly invisible. I did remove the #ifdef though since it was pointless the way it was.
Let me know if you notice any other issues
from zenject-2019.
Maybe I'm a bit of unclear, since I'm not a native English speaker. The "cursor problem" was with the import in 5.1. The original code (as in the asset store version) is
#if UNITY_5_0
Cursor.visible = false;
#else
Screen.showCursor = false;
#endif`
The first one is for Unity 5, the second should be for Unity 4 or earlier. But Unity 5.1 has different define UNITY_5_1
and thus chooses the version for Unity 4. And then it converts it to the same Cursor.visible = false;
. So it is necessary to use UNITY_5 define or both UNITY_5_0 and UNITY_5_1. Or, as you did, just throw defines away and only leave Cursor.visible = false;
, if Unity 4 support is no more necessary.
I don't see any other bugs so far. Probably could give you some criticism about the code, if you are open to it. But since my opinion could be a bit of subjective and personal, I'll better write you an email.
Nevertheless, I tried six IoC solutions for Unity (Zenject, StrangeIoC, MinIoC, Adic, uInject, Svelto) and Zenject seems to be best. StrangeIoC is too overcomplicated, Svelto is too simplified, MinIoC does strange things even in its description and examples (e.g. injection into serialized fields of MonoBehaviour), uInject propagates the use of DIMono abstract class instead of MonoBehaviour, Adic requires Inject
to be called from MonoBehaviour etc. Only Zenject does what I expect from an IoC/DI framework. So keep up te good work.
from zenject-2019.
Thanks :) I'm glad you're enjoying it
I see what you mean now. I'm not sure how many people are still using Unity 4 but I might as well remain compatible with it, since that's the only change required. So I've made the change you recommended.
Sure, if you have thoughts on the code I'm happy to hear them. My email is [email protected]. I've played with a few of the other frameworks you've mentioned but not very much, so if you have observed anything useful in those I'd be happy to hear those too.
Personally, my biggest gripe with Zenject is that it doesn't have very good support for nested containers. This is something I plan to address with the next release. Then after that, probably convention based binding.
from zenject-2019.
Related Issues (20)
- User Error -> StackOverflow AssertHit! (999+ times) HOT 2
- Why did you stop publishing in the asset store? HOT 4
- Interfaces and FromComponentInNewPrefab
- Declaring Factory for Object which doesn't have all its dependencies yet
- NullReferenceException in the MonoKernel.Start ()
- Error at project Upgrade HOT 4
- Cant add Zenject-TestFramework to Solution HOT 1
- Injection is happning twice
- Inject reference of a monobehaviour to an instantiated gameobject HOT 1
- "Commitment to open source" and lawsuit HOT 4
- Zenject causes gameObjects destroying just after start
- Typo in readme
- Automocking with Moq internal constructor not visible with Reflection HOT 4
- DiContainer.Resolve exception handling
- Why so many projects and files are added? HOT 1
- ZenjectException: Assert Hit! Expected null pointer but instead found 'Zenject.DiContainer' HOT 1
- DI on base class?
- Objects which class with interface implemented couldn't be inject correctly
- Support for IAsyncDisposable?
- Object that has Reference to the SceneContext stay in memory after scene unloaded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zenject-2019.