Say I have a class that has a property, a float called health. It has a setter.
public float Health
{
set
{
health = value;
}
}
Either in this class or I guess anywhere else, there is an event that sends out a float:
public event Action<float> EventWithFloat;
Can I somehow hook up calling the setter of the property to be called when that event is triggered? Without writing an extra method (that calls the property).
So something like EventClass.EventWithFloat += Health;
Thanks