146 lines
4.0 KiB
C#
146 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Text;
|
|
using MAI2;
|
|
using UnityEngine;
|
|
|
|
// Token: 0x0200001E RID: 30
|
|
[ProjectPrefs("outputlogPathKey", "ログ出力ファイル先", "DebugLog", typeof(string))]
|
|
public static class CustomDebug
|
|
{
|
|
// Token: 0x0600009A RID: 154 RVA: 0x0000405D File Offset: 0x0000325D
|
|
[Conditional("APP_DEBUG")]
|
|
public static void Log(object message)
|
|
{
|
|
CustomDebug.LogInternal(message, null, Color.white);
|
|
}
|
|
|
|
// Token: 0x0600009B RID: 155 RVA: 0x00004070 File Offset: 0x00003270
|
|
[Conditional("APP_DEBUG")]
|
|
public static void Log(object message, Object context)
|
|
{
|
|
CustomDebug.LogInternal(message, context, Color.white);
|
|
}
|
|
|
|
// Token: 0x0600009C RID: 156 RVA: 0x00004083 File Offset: 0x00003283
|
|
[Conditional("APP_DEBUG")]
|
|
public static void Log(object message, Object context, Color color)
|
|
{
|
|
CustomDebug.LogInternal(message, context, color);
|
|
}
|
|
|
|
// Token: 0x17000017 RID: 23
|
|
// (get) Token: 0x0600009D RID: 157 RVA: 0x00004092 File Offset: 0x00003292
|
|
// (set) Token: 0x0600009E RID: 158 RVA: 0x00004099 File Offset: 0x00003299
|
|
public static bool IsWatching { get; private set; }
|
|
|
|
// Token: 0x0600009F RID: 159 RVA: 0x000040A4 File Offset: 0x000032A4
|
|
[Conditional("UNITY_EDITOR")]
|
|
public static void Watch(string keyName, object message)
|
|
{
|
|
if (CustomDebug.watchList == null)
|
|
{
|
|
CustomDebug.watchList = new Dictionary<string, DebugWatchData>();
|
|
}
|
|
if (CustomDebug.watchList.ContainsKey(keyName))
|
|
{
|
|
CustomDebug.watchList[keyName].Message = message;
|
|
}
|
|
else
|
|
{
|
|
CustomDebug.watchList.Add(keyName, new DebugWatchData
|
|
{
|
|
Key = keyName,
|
|
Message = message,
|
|
StackTrace = StackTraceUtility.ExtractStackTrace()
|
|
});
|
|
}
|
|
CustomDebug.IsWatching = true;
|
|
}
|
|
|
|
// Token: 0x060000A0 RID: 160 RVA: 0x00004111 File Offset: 0x00003311
|
|
public static int GetWatchCount()
|
|
{
|
|
if (CustomDebug.watchList != null)
|
|
{
|
|
return CustomDebug.watchList.Count;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// Token: 0x060000A1 RID: 161 RVA: 0x00004128 File Offset: 0x00003328
|
|
public static string GetWatch()
|
|
{
|
|
if (CustomDebug.watchList == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
CustomDebug.sb.Length = 0;
|
|
foreach (string text in CustomDebug.watchList.Keys)
|
|
{
|
|
CustomDebug.sb.AppendLine(text + "\t" + CustomDebug.watchList[text]);
|
|
}
|
|
CustomDebug.IsWatching = false;
|
|
return CustomDebug.sb.ToString();
|
|
}
|
|
|
|
// Token: 0x060000A2 RID: 162 RVA: 0x000041C4 File Offset: 0x000033C4
|
|
public static DebugWatchData GetWatchData(int i)
|
|
{
|
|
int num = 0;
|
|
foreach (DebugWatchData debugWatchData in CustomDebug.watchList.Values)
|
|
{
|
|
if (num == i)
|
|
{
|
|
return debugWatchData;
|
|
}
|
|
num++;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x060000A3 RID: 163 RVA: 0x00004228 File Offset: 0x00003428
|
|
public static void ClearWatchs()
|
|
{
|
|
if (CustomDebug.watchList != null)
|
|
{
|
|
CustomDebug.watchList.Clear();
|
|
CustomDebug.watchList = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000A4 RID: 164 RVA: 0x00004244 File Offset: 0x00003444
|
|
private static void LogInternal(object message, Object context, Color32 color)
|
|
{
|
|
color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2");
|
|
global::MAI2.DateTime.Now.ToString("HH:mm:ss");
|
|
}
|
|
|
|
// Token: 0x060000A5 RID: 165 RVA: 0x000042A0 File Offset: 0x000034A0
|
|
private static void LogWarning(object message, Color32 color)
|
|
{
|
|
color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2");
|
|
global::MAI2.DateTime.Now.ToString("HH:mm:ss");
|
|
}
|
|
|
|
// Token: 0x060000A6 RID: 166 RVA: 0x000042FC File Offset: 0x000034FC
|
|
private static void LogError(object message, Color32 color)
|
|
{
|
|
color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2");
|
|
global::MAI2.DateTime.Now.ToString("HH:mm:ss");
|
|
}
|
|
|
|
// Token: 0x04000058 RID: 88
|
|
private const string LOG_PATH = "outputlogPathKey";
|
|
|
|
// Token: 0x04000059 RID: 89
|
|
public const string LOG_CLASS_NAME = "";
|
|
|
|
// Token: 0x0400005A RID: 90
|
|
private static StringBuilder sb = new StringBuilder();
|
|
|
|
// Token: 0x0400005B RID: 91
|
|
private static Dictionary<string, DebugWatchData> watchList = new Dictionary<string, DebugWatchData>();
|
|
}
|