/// <summary> /// Called when the attached Behaviour is destroying. /// </summary> private void OnDestroy() { if (!lastShowable.IsNullOrMissing()) { lastShowable.OnStopShowing -= OnStopShowingHandler; } }
/// <summary> /// Called when the attached Behaviour is destroying. /// </summary> private void OnDestroy() { if (lastShowable.IsNullOrMissing()) { return; } lastShowable.OnShowableDataChanges -= UpdateShowableData; if (lastShowable is IShowableHealth showableHealth) { showableHealth.OnHealthChanges -= OnHealthChangesHandler; } }