Beispiel #1
0
        /// <summary>
        /// Returns this object to the object pool.
        /// </summary>
        public virtual void DestroyAsPoolableObject()
        {
            if (OnDie != null)
            {
                foreach (Action <IDying> handler in OnDie.GetInvocationList())
                {
                    OnDie -= handler;
                }
            }

            OnDestroyAsPoolableObject?.Invoke(this);
        }
Beispiel #2
0
 /// <summary>
 /// Returns this object to the object pool.
 /// </summary>
 public void DestroyAsPoolableObject() => OnDestroyAsPoolableObject?.Invoke(this);
 /// <summary>
 /// Returns this object to the object pool.
 /// </summary>
 public void DestroyAsPoolableObject()
 {
     UnsubscribeForHealthChanges();
     OnDestroyAsPoolableObject?.Invoke(this);
 }