コード例 #1
0
ファイル: Unit.cs プロジェクト: Siuniaev/RTS-Survival-Game
        /// <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);
        }
コード例 #2
0
 /// <summary>
 /// Returns this object to the object pool.
 /// </summary>
 public void DestroyAsPoolableObject() => OnDestroyAsPoolableObject?.Invoke(this);
コード例 #3
0
 /// <summary>
 /// Returns this object to the object pool.
 /// </summary>
 public void DestroyAsPoolableObject()
 {
     UnsubscribeForHealthChanges();
     OnDestroyAsPoolableObject?.Invoke(this);
 }