I have a Monobehaviour object BaseUnit which can have some states, so I created states factory, like in the Zenject example projects, but my question is how to pass reference of this BaseUnit when I create this factory of states for this BaseUnit?
public class UnitStateFactory
{
readonly UnitMoveState.Factory _moveState;
readonly UnitActiveState.Factory _activeState;
readonly BaseUnit _unit;
public UnitStateFactory(
UnitMoveState.Factory mS,
UnitActiveState.Factory aS,
BaseUnit unit
)
{
_moveState = mS;
_activeState = aS;
_unit = unit;
}
}