I'm new to Entitas. I have a DamageSystem that should Physics.Raycast() toward the target and if tag is enemy it should reduce enemy health.
I have HealthComponent:
public class HealthComponent: IComponent{
public float value;
}
In DamageSystem I wanna do something like:
if(Physics.Raycast(target, direction, out hit)){
tag.gameObject.entity.health.value = currentHealth - damage ;
}
But after Physics.Raycast(), I have only the gameObject and getEntityLink() method that return EntityLink without actual components... I guess that getEntityLink() returns only abstract components, and there is no way to get HealthComponent from EntityLink?
Does someone know how to get components from EntityLink, in a clean manner?
Thanks!