public void Death() { if (!attributes.isAlive) { return; } if (attributes.data.IsCaster) { skillTable.CurrentCell.Stop(); } attributes.isAlive = false; if (attributes.SheildPoint > 0f) { attributes.SheildPoint = 0f; } //清空所有buff while (buffs.Count > 0) { LogOffBuff(buffs[0]); } Debug.Log(gameObject.name + " has died."); DeathEvnt.Trigger(); //注销单位 lock (GameDB.unitPool) Gamef.UnitClear(this); StartCoroutine(DelayedDestroy()); }
private void OnDestroy() { //注销单位 lock (GameDB.unitPool) Gamef.UnitClear(this); }