// When the object is disabled, remove this from the channel to avoid unnecessary event raising private void OnDisable() { _event.UnregisterListener(this); }
private void OnDestroy() { healthChangedEvent.UnregisterListener(UpdateHealthBar); }
// When the object is disabled, remove this from the channel to avoid unnecessary event raising private void OnDisable() { _event.UnregisterListener(this); }
private void OnDestroy() { healthChangedEvent.UnregisterListener(UpdateHealthBar); }