Data Injection
Why is Data Injection Needed?
How Does It Work?
Example
using CrashKonijn.Goap.Interfaces;
public class GoapInjector : MonoBehaviour, IGoapInjector
{
public ItemFactory itemFactory;
public ItemCollection itemCollection;
public InstanceHandler instanceHandler;
public void Inject(IActionBase action)
{
if (action is IInjectable injectable)
injectable.Inject(this);
}
public void Inject(IGoalBase goal)
{
}
public void Inject(IWorldSensor worldSensor)
{
}
public void Inject(ITargetSensor targetSensor)
{
}
}Connecting the injector

Example
Zenject
Last updated