/// <summary> /// 缓存血条 /// </summary> /// <param name="b"></param> static void CacheBlood(GfxBlood b) { if (!OptimitzedControlPlane.Instance.EnityCreateOptimize || null == b) { return; } ENTITY_TYPE entity_Type = b.bloodType; if (!m_CacheBlood.ContainsKey(entity_Type)) { Debug.LogError("缓存" + entity_Type + "类型血条失败,请在InitCache中添加!"); return; } int id = b.ID; //不存主角 if (id == EntityFactory.MainHeroID) { return; } if (m_BloodMap.ContainsKey(id)) { b.SetEnable(false); b.SetBloodColor(false); b.ChangeParent(CacheBloodRoot.transform); Queue <GfxBlood> m_list = m_CacheBlood[entity_Type]; m_list.Enqueue(b); m_BloodMap.Remove(id); } }