/// <summary> /// 回收血条 /// </summary> public void Recycle(object owner) { IHpBarBase hpBar = null; if (TryGetValue(owner, out hpBar)) { RecycleBar(hpBar); hpBar.Recycle(); hpData.Remove(owner); var hpType = GetHpOwnerType(owner); if (hpCache.ContainsKey(hpType)) { hpCache[hpType].Enqueue(hpBar); } else { var cache = new Queue <IHpBarBase>(); cache.Enqueue(hpBar); hpCache.Add(hpType, cache); } } }