Extenject icon indicating copy to clipboard operation
Extenject copied to clipboard

Ignore all types in UnityEngine namespace

Open pnarimani opened this issue 4 years ago • 2 comments

Currently TypeAnalyzer class tries to get type info of all classes that are in UnityEngine namespaces. I think this is a waste of time since no component or behaviour in UnityEngine namespace uses injection.

I created this issue to discuss this potential change and see if anything breaks if we ignore everything from Unity.

pnarimani avatar May 04 '21 14:05 pnarimani

Instead of checking each class for its namespace, we can filter UnityEngine/UnityEditor assemblies, skipping them altogether.

Assemblies whose names start with "System." should also be skipped then. It is unlikely there are any custom assemblies that use Zenject and are named this way.

SolidAlloy avatar Jun 30 '21 17:06 SolidAlloy

Instead of checking each class for its namespace, we can filter UnityEngine/UnityEditor assemblies, skipping them altogether.

Assemblies whose names start with "System." should also be skipped then. It is unlikely there are any custom assemblies that use Zenject and are named this way.

The important thing about this issue is that you cannot instantiate things that you ignore. I assume that nobody is going to use InstantiateExplicit on Unity components. But with System classes is a little bit tricky.

pnarimani avatar May 14 '22 21:05 pnarimani