C#C
C#3y ago
Theos

❔ Zenject (Unity) doesn't fire when i do new()

Hey,

I have a class which looks like this

public class Something
{
  private A _a;

  private B _b;

  public Something(A a)
  {
    _a = a;
  }

  [Inject]
  public void Construct(B b)
  {
    _b = b;
  }


public class Test : MonoBehaviour
{

  public void Start()
  {
    var smth = new Something(_a);
  }
}


and _b is null for some reason?
Was this page helpful?