public string UF_GetPoolEntityInfo() { if (m_PoolEntitys.Count > 0) { var dicCache = DictionaryCache <string, int> .Acquire(); System.Text.StringBuilder infoStr = StrBuilderCache.Acquire(); infoStr.Remove(0, infoStr.Length); m_PoolEntitys.UF_NForeach( (e) => { if (e != null) { if (!dicCache.ContainsKey(e.name)) { dicCache.Add(e.name, 0); } dicCache[e.name] = dicCache[e.name] + 1; } return(true); } ); foreach (KeyValuePair <string, int> item in dicCache) { if (item.Value > 0) { int tick = (int)(GTime.Time - m_PoolEntitys.UF_Get(item.Key).timeStamp); infoStr.AppendLine(string.Format("{0} : {1} -> {2}", item.Key, item.Value, tick)); } } DictionaryCache <string, int> .Release(dicCache); return(StrBuilderCache.GetStringAndRelease(infoStr)); } return(string.Empty); }
public string UF_GetActiveEntityInfo() { if (m_ListActive.Count > 0) { System.Text.StringBuilder infoStr = StrBuilderCache.Acquire(); var dicCache = DictionaryCache <string, int> .Acquire(); m_ListActive.UF_NForeach( (e) => { if (e != null) { if (!dicCache.ContainsKey(e.name)) { dicCache.Add(e.name, 0); } dicCache[e.name] = dicCache[e.name] + 1; } return(true); } ); foreach (KeyValuePair <string, int> item in dicCache) { if (item.Value > 0) { infoStr.AppendLine(string.Format("{0} : {1}", item.Key, item.Value)); } } DictionaryCache <string, int> .Release(dicCache); return(StrBuilderCache.GetStringAndRelease(infoStr)); } return(string.Empty); }