Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baking Issues #14

Open
extrawurst opened this issue Jun 1, 2019 · 1 comment
Open

Baking Issues #14

extrawurst opened this issue Jun 1, 2019 · 1 comment

Comments

@extrawurst
Copy link

Hey @svermeulen sorry to bother you with this. But I am still struggling with those baking issues since 8.0.1: https://github.com/modesttree/Zenject/issues/603

I am now using namespace pattern ^ and I tried checking All generated Assemblies and still see some types not being found in the baking data like:

LayoutGroup
GraphicRaycaster
TMP_InputField
...

Actually all these types I don't need Zenject to Inject. Is there maybe a way to annotate a field to be ignored in the Injection phase to? Something like [NoInject]?

I am on Unity 2018.3.4.1f1

@svermeulen
Copy link

There is the [NoReflectionBaking] attribute.

One important thing to be aware of is that zenject is only able to add reflection baking to libraries that reference Zenject-usage.dll (since baking needs to add code that makes use of that to the library). So if you have a library that has MonoBehaviours in it, which doesn't reference zenject, and you include that a zenject scene, that it will have to use runtime injection.

If you're sure that everywhere that you need injection is baked, then you can use the ReflectionBakingCoverageModes.NoCheckAssumeFullCoverage mode. This will not fallback on runtime reflection so you can avoid the performance penalty for monobehaviours you don't care about, but you have to be careful that everything is fully baked for that to work. FallbackToDirectReflectionWithWarning is useful to list all the classes would be skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants