示例#1
0
        private static void DumpRecursively(object messageObj, int logLevel, int treeLevel)
        {
            Dictionary <object, object> dictionary = null;

            try
            {
                dictionary = (Dictionary <object, object>)messageObj;
            }
            catch (Exception ex)
            {
                global::Debug.LogFormat("Dumpメソッドのキャストが失敗. {0}", new object[]
                {
                    ex
                });
                return;
            }
            foreach (KeyValuePair <object, object> keyValuePair in dictionary)
            {
                switch (logLevel)
                {
                case 0:
                    global::Debug.LogFormat("{0}{1}:{2}", new object[]
                    {
                        new string('-', treeLevel),
                        keyValuePair.Key,
                        keyValuePair.Value
                    });
                    break;

                case 1:
                    global::Debug.LogWarningFormat("{0}{1}:{2}", new object[]
                    {
                        new string('-', treeLevel),
                        keyValuePair.Key,
                        keyValuePair.Value
                    });
                    break;

                case 2:
                    global::Debug.LogErrorFormat("{0}{1}:{2}", new object[]
                    {
                        new string('-', treeLevel),
                        keyValuePair.Key,
                        keyValuePair.Value
                    });
                    break;

                default:
                    global::Debug.LogFormat("{0}{1}:{2}", new object[]
                    {
                        new string('-', treeLevel),
                        keyValuePair.Key,
                        keyValuePair.Value
                    });
                    break;
                }
                MultiTools.DumpRecursively(keyValuePair.Value, logLevel, treeLevel + 1);
            }
        }
示例#2
0
 public static void DumpError(object messageObj)
 {
     MultiTools.DumpRecursively(messageObj, 2, 0);
 }
示例#3
0
 public static void DumpWarning(object messageObj)
 {
     MultiTools.DumpRecursively(messageObj, 1, 0);
 }