コード例 #1
0
    private static string GetColorName(DebugColors color)
    {
        switch (color)
        {
        case DebugColors.Black:
            return("black");

        case DebugColors.Blue:
            return("blue");

        case DebugColors.Cyan:
            return("cyan");

        case DebugColors.Green:
            return("green");

        case DebugColors.Gray:
            return("gray");

        case DebugColors.Magenta:
            return("magenta");

        case DebugColors.Red:
            return("red");

        case DebugColors.Yellow:
            return("yellow");

        case DebugColors.Teal:
            return("teal");
        }

        return(null);
    }
コード例 #2
0
    public static void LogError(object message, DebugColors color, Object context = default)
    {
#if FULL_LOG || (POST_BUILD_HASH && UNITY_EDITOR)
        string newMessage = FormatMessage(message, color);

        Debug.LogError(newMessage, context);
#endif
    }
コード例 #3
0
    public static void LogWarning(object message, DebugColors color, Object context = default)
    {
#if !FULL_LOG
        return;
#endif
        string newMessage = FormatMessage(message, color);

        Debug.LogWarning(newMessage, context);
    }
コード例 #4
0
ファイル: Debug.cs プロジェクト: MaxPlay/PNCEngine
 private void LoadDefaults()
 {
     this.colors      = new DebugColors();
     colors.Default   = DEFAULT_DEFAULT;
     colors.Warning   = DEFAULT_WARNING;
     colors.Error     = DEFAULT_ERROR;
     colors.Critical  = DEFAULT_CRITICAL;
     colors.Attention = DEFAULT_ATTENTION;
     clearOnLoad      = DEFAULT_CLEAR_LOG_FILE_ON_LOAD;
 }
コード例 #5
0
    private static string FormatMessage(object message, DebugColors color)
    {
        string colorName    = GetColorName(color);
        var    newLineSplit = message.ToString().Split('\n');
        var    newMessage   = string.Empty;

        foreach (string str in newLineSplit)
        {
            newMessage += $"<color={colorName}>{str}</color>\n";
        }

        return(newMessage);
    }
コード例 #6
0
ファイル: DynamicTerrain.cs プロジェクト: aarondesin/route95
 /// <summary>
 /// Sets all chunks to use debug colors.
 /// </summary>
 /// <param name="colors"></param>
 public void SetDebugColors(DebugColors colors)
 {
     switch (colors)
     {
     case DebugColors.Constrained:
         foreach (Chunk chunk in _activeChunks)
         {
             chunk.GetComponent <MeshRenderer>().material = WorldManager.Instance.TerrainDebugMaterial;
             chunk.SetDebugColors(colors);
         }
         break;
     }
 }
コード例 #7
0
 /// <summary>
 /// Sets the color of the text according to the parameter value.
 /// </summary>
 /// <param name="message">Message.</param>
 /// <param name="color">Color.</param>
 public static string StrColored(this string message, DebugColors color)
 {
     return(string.Format("<color={0}>{1}</color>", color.ToString(), message));
 }