Exemple #1
0
 /// <summary>
 /// Called when the attached Behaviour is destroying.
 /// </summary>
 private void OnDestroy()
 {
     if (!lastShowable.IsNullOrMissing())
     {
         lastShowable.OnStopShowing -= OnStopShowingHandler;
     }
 }
Exemple #2
0
        /// <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;
            }
        }