Пример #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);
        }