So a general question:
How to deal with dependencies that is instantiated?
Say I have two functions:
public class Manager : ScriptableObject
{
private var data;
private void GetDataFromTextAsset() => data = BuildData();
public bool IsValidInput(var input)
{
if(data.SomeAspectIsTrue)
return true;
return false;
}
}
public class User
{
public void SomeFunction(var input)
{
if(_manager.IsValidInput(input))
DoStuff();
}
}
what is the proper way to solve such a dependency, that decouples the two classes, is scalable and testable?
I want to use Zenject, but I’m not sure if that is good for this specific issue
also i guess singletons are out the window?