How can you add a component to a gameobject? The normal path of
GameObject obj = _factory.Create(); // Creates from prefab
HasScore score = obj.AddComponent<HasScore>(); // attach the component
The problem is that HasScore
component is not going through IoC
hence the dependencies are not injected. My question is how do I add a component? Or how do I make it go through IoC
? I couldn't find this in the docs, if anyone does it'll be much appriciated
[Inject]
public void Initialize(SomeSignal.Trigger trigger)
{
_trigger = trigger;
Debug.Log("[+] Injecting in HasScore...");
}