Relative Content

Tag Archive for unity-game-enginedependency-injectionzenject

How do I use Zenject’s Method Injection when there are parameters in the constructor?

public interface IVector3ValueList { public List<Vector3> GetVector3List(); } public class Vector3ListGetter : IVector3ValueList { private List<float> xList, yList, zList; public Vector3ListGetter(List<float> xList, List<float> yList, List<float> zList) { this.xList = xList; this.yList = yList; this.zList = zList; } public List<Vector3> GetVector3List() { float minX = xList.Min(); float minY = yList.Min(); float minZ = zList.Min(); // return […]