using UnityEngine; using System.Collections.Generic; using System; public static class ISAdQualityUtils { private static bool isDebugBuild = false; private static bool isDebugBuildSet = false; /// /// Creates Log Debug message according to given tag and message. /// /// The name of the class whose instance called this function. /// Debug message to output to log. public static void LogDebug(string tag, string message) { if (!isDebugBuildSet) { try //Debug.isDebugBuild can fail on WP8 if it is not called from the Main Thread { isDebugBuild = Debug.isDebugBuild; } catch (Exception e) { isDebugBuild = true; Debug.Log(string.Format("{0} {1}", tag, e.Message)); } isDebugBuildSet = true; } if (isDebugBuild) { Debug.Log(string.Format("{0} {1}", tag, message)); } } /// /// Creates Log Error message according to given tag and message. /// /// The name of the class whose instance called this function.. /// Error message to output to log. public static void LogError(string tag, string message) { Debug.LogError(string.Format("{0} {1}", tag, message)); } public static void LogWarning(string tag, string message) { Debug.LogWarning(string.Format("{0} {1}", tag, message)); } /// /// Returns the class name to be used in serialization/deserialization process /// /// The target to get class name for /// The class name of the provided instance public static string GetClassName(object target) { return target.GetType().Name; } }