







My game has healer bots -- they revive other bots when they go down. Right now, I’ve just made them by copying the basic shooters and adding them a med. bag as a quick fix, but I was planning to give them lab coats later so they’re easy to spot from a distance.
However, to encourage the player to play more aggressively and because I like the idea of turning a generic enemy into a recurring 'utility' threat, I’m thinking of moving forward with only these medic-shooters and ditching the non-medics entirely.
So now I'm wondering: is it actually fine to keep the sprites identical? Since I’m getting rid of the non-healers anyway.
Somewhy healers from different rooms are being registered in the same RoomHealing instance. Because of that, appointment of healers on downed comrades is not working properly. I am imagining some ways to workaround this VContainer situation, but I am lost in frustration. How could this happen? Debug and going through state showed me that both healers are registering in the one object and not registering in other instances.
Attached my hierarchy. RoomUnits and RoomHealing are POCOs and are constructed inside RoomContextScope:
protected override void Configure(IContainerBuilder builder)
{
builder.Register(resolver =>
{
var units = new RoomUnits();
ToPrivateScope(resolver).Inject(units);
return units;
}, Lifetime.Singleton);
builder.Register(resolver =>
{
var healing = new RoomHealing();
ToPrivateScope(resolver).Inject(healing);
return healing;
}, Lifetime.Singleton);
builder.RegisterBuildCallback(resolver =>
{
resolver.Resolve<RoomUnits>().Init();
resolver.Resolve<RoomHealing>().Init();
});
}
private IObjectResolver ToPrivateScope(IObjectResolver resolver) => resolver.CreateScope(builder =>
{
builder.RegisterInstance(gameObject);
builder.RegisterInstance(this).As<MonoBehaviour>();
});