public static void DrawLine(DebugPrefix type, Vector3 start, Vector3 end, Color?color = null, float duration = 1.0f, bool depthTest = true) { if (Check(type)) { Debug.DrawLine(start, end, color ?? Color.blue, duration, depthTest); } }
public static void Error(DebugPrefix type, string str) { if (Check(type)) { str = type + DateTime.Now.ToString(": yyyyMMdd_HHmmss \r\n") + str; Debug.LogError(str); } }
static bool IsEnable(DebugPrefixEnum prefix) { if (EnabledPrefixes == null) { var prefixes = Resources.LoadAll <DebugPrefix>("DebugPrefix"); DebugPrefix debugPrefix = prefixes[0]; EnabledPrefixes = debugPrefix.EnabledPrefixes; } return(EnabledPrefixes.FirstOrDefault(x => x.PrefixName == prefix.ToString()) != null); }
static bool Check(DebugPrefix type) { int index = (int)type; if (Config != null) { if (Config.Enable && Config.Switch[index]) { return(true); } } else { if (Enable && Switch[index]) { return(true); } } return(false); }