Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public override string ToString()
        {
            System.Text.StringBuilder sb = StrBuilderCache.Acquire();

            if (m_ViewStack != null && m_ViewStack.Count > 0)
            {
                sb.Append("\n========== View Stack ==========\n");
                sb.AppendLine();
                for (int k = 0; k < m_ViewStack.Count; k++)
                {
                    if (m_ViewStack.Elements[k] != null)
                    {
                        sb.AppendLine(string.Format("<color=green>{0} | order:{1} | tpye: <{2}></color>", m_ViewStack.Elements[k].name, m_ViewStack.Elements[k].viewOrder.ToString(), m_ViewStack.Elements[k].viewType.ToString()));
                        //检查是否有content 内容
                        List <Object> list = m_ViewStack.Elements[k].ListUpdateUI;
                        for (int t = 0; t < list.Count; t++)
                        {
                            if (list[t] is UIContent && (list[t] as UIContent).target != null)
                            {
                                //sb.AppendLine();
                                sb.AppendLine(string.Format("\t\t<color=yellow>{0}->{1}</color>", (list[t] as UIContent).updateKey, (list[t] as UIContent).target.name));
                            }
                        }
                        sb.AppendLine();
                    }
                    else
                    {
                        sb.AppendLine("<color=red> <NULL> </color>");
                    }
                }
            }

            return(StrBuilderCache.GetStringAndRelease(sb));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public override string ToString()
 {
     System.Text.StringBuilder sb = StrBuilderCache.Acquire();
     sb.Append(string.Format("RefObjectManager count:{0} \n", m_DicRefObjects.Count));
     foreach (RefObject refObj in m_DicRefObjects.Values)
     {
         sb.Append(string.Format("\t {0} | type<{1}> | ref -> {2}\n", refObj.target.name, refObj.target.GetType().Name, refObj.Refcount));
     }
     return(StrBuilderCache.GetStringAndRelease(sb));
 }
Esempio n. 5
0
 public override string ToString()
 {
     System.Text.StringBuilder sb = StrBuilderCache.Acquire();
     sb.Append(string.Format("PDataManager  count:{0} \n", m_DicPersistentData.Count));
     foreach (KeyValuePair <string, ConfigFile> item in m_DicPersistentData)
     {
         sb.Append(string.Format("\t {0} \n", item.Key));
     }
     return(StrBuilderCache.GetStringAndRelease(sb));
 }
Esempio n. 6
0
 public override string ToString()
 {
     System.Text.StringBuilder sb = StrBuilderCache.Acquire();
     sb.Append(string.Format("Audio  Count:{0} \n", m_ListAudios.Count));
     for (int k = 0; k < m_ListAudios.Count; k++)
     {
         sb.Append(string.Format("\t {0}  | Type:{1}  |  State:{2}\n", m_ListAudios [k].name, m_ListAudios [k].audioType, m_ListAudios [k].isPlaying.ToString()));
     }
     return(StrBuilderCache.GetStringAndRelease(sb));
 }
Esempio n. 7
0
        public override string ToString()
        {
            System.Text.StringBuilder body = StrBuilderCache.Acquire();
            int count = m_DicBundleBuffer.Values.Count;

            body.AppendFormat("[{0}/{1}] [AssAssetBundle] <{2}>\n", (int)m_TickDuration, m_MaxTickCount, count);
            foreach (AssetBundleData item in m_DicBundleBuffer.Values)
            {
                body.AppendFormat("{0} | <color=yellow>ref -> {2}</color> <color={4}>flag[{1}]</color> <color={5}>tick [{3}]</color>\n",
                                  item.name, item.flag, item.refCount, item.tick,
                                  item.flag == LoadAssetBundleOptions.UNLOAD_IN_NO_REF ? "green" : "white",
                                  item.tick > 0?"red":"grey");
            }
            return(StrBuilderCache.GetStringAndRelease(body));
        }
Esempio n. 8
0
        public override string ToString()
        {
            System.Text.StringBuilder sb   = StrBuilderCache.Acquire();
            List <FXController>       list = ListCache <FXController> .Acquire();

            UF_GetAllActiveFXController(list);
            sb.AppendLine(string.Format("FX  Count:{0} \n", list.Count));
            foreach (FXController val in list)
            {
                if (val != null)
                {
                    sb.AppendLine(string.Format("\t {0} | life: {1} | left: {2} ", val.name, val.life, val.leftLife));
                }
            }
            ListCache <FXController> .Release(list);

            return(StrBuilderCache.GetStringAndRelease(sb));
        }
Esempio n. 9
0
 public override string ToString()
 {
     System.Text.StringBuilder sb = StrBuilderCache.Acquire();
     sb.Append(string.Format("tickCount={0} \n connectCount={1}", tickCount, connectCount));
     sb.Append("connectInfo:\n");
     for (int k = 0; k < m_ListConnections.Count; k++)
     {
         if (m_ListConnections [k] != null)
         {
             NetConnection connection = m_ListConnections [k];
             sb.Append(string.Format("\tIP:{0} | Port:{1} | State:{2} | R:{3} | W:{4}\n",
                                     connection.host,
                                     connection.port,
                                     connection.connectState,
                                     connection.readBufferSize,
                                     connection.writeBufferSize));
         }
     }
     return(StrBuilderCache.GetStringAndRelease(sb));
 }
Esempio n. 10
0
        public static void UF_Error(string error)
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(true);
            System.Text.StringBuilder     sb = StrBuilderCache.Acquire();
            sb.AppendLine(error);
            sb.AppendLine("Stack:");
            foreach (System.Diagnostics.StackFrame sf in st.GetFrames())
            {
                sb.AppendLine(string.Format("\t{0}.{1}:{2}",
                                            sf.GetMethod().DeclaringType.FullName,
                                            sf.GetMethod().Name,
                                            sf.GetFileLineNumber()
                                            ));
            }
            string info = StrBuilderCache.GetStringAndRelease(sb);

                        #if UNITY_EDITOR
            Debug.LogError(info);
                        #endif
            //ingore active ,still write to loger
            Debugger.UF_GetInstance().UF_LogMessage(TAG_ERROR, info);
        }
Esempio n. 11
0
        //系统相关信息
        private void UF_DrawTagInfo()
        {
            GUILayout.Space(4);
            System.Text.StringBuilder sb = StrBuilderCache.Acquire();
            sb.Append(string.Format("AppPath:{0}", GlobalPath.AppPath));
            sb.AppendLine();
            sb.Append(string.Format("StreamingAssetsPath:{0}", GlobalPath.StreamingAssetsPath));
            sb.AppendLine();
            sb.Append(string.Format("PersistentPath:{0}", GlobalPath.PersistentPath));
            sb.AppendLine();
            sb.Append(string.Format("DeviceModel: {0}", GlobalSettings.DeviceModel));
            sb.AppendLine();
            sb.Append(string.Format("DeviceIMEI: {0}", GlobalSettings.DeviceIMEI));
            sb.AppendLine();
            sb.Append(string.Format("DeviceOS: {0}", GlobalSettings.DeviceOS));
            sb.AppendLine();
            sb.Append(string.Format("Battery: {0}", GlobalSettings.BatteryValue));
            sb.AppendLine();
            sb.Append(string.Format("BatteryStatus: {0}", GlobalSettings.BatteryStatus));

            GUILayout.TextArea(StrBuilderCache.GetStringAndRelease(sb));
        }
Esempio n. 12
0
 public string UF_ForeachToString(DelegateMsgToStrForeach method)
 {
     try{
         System.Text.StringBuilder sb = StrBuilderCache.Acquire();
         sb.Remove(0, sb.Length);
         if (m_PtrCurIdx == m_TrackInfo.Length - 1)
         {
             for (int k = 0; k < m_TrackInfo.Length; k++)
             {
                 sb.AppendLine(method(m_TrackInfo[k], m_TrackStamp[k]));
             }
         }
         else if (m_TrackInfo[m_PtrCurIdx + 1] != null)
         {
             for (int k = m_PtrCurIdx + 1; k < m_TrackInfo.Length; k++)
             {
                 sb.AppendLine(method(m_TrackInfo[k], m_TrackStamp[k]));
             }
             for (int k = 0; k <= m_PtrCurIdx; k++)
             {
                 sb.AppendLine(method(m_TrackInfo[k], m_TrackStamp[k]));
             }
         }
         else
         {
             for (int k = 0; k <= m_PtrCurIdx; k++)
             {
                 sb.AppendLine(method(m_TrackInfo[k], m_TrackStamp[k]));
             }
         }
         return(StrBuilderCache.GetStringAndRelease(sb));
     }
     catch (System.Exception e) {
         Debugger.UF_Exception(e);
         return(string.Empty);
     }
 }