-
-
Save todorok1/d56d1b239c030c11ede22fc435eb397b to your computer and use it in GitHub Desktop.
ゲーミングDebug.Logのサンプルメソッド
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <Summary> | |
/// 行ごとに文字の色を変化させて出力します。 | |
/// </Summary> | |
public static void OutputColoredLine(string msg, ColorCodeHolder.ColorToneName toneName) | |
{ | |
// 文字の色を定義した配列を取得します。 | |
string[] colorCodeArray = ColorCodeHolder.GetColorToneArray(toneName); | |
// 1文字ずつ色を変えてループするようにします。 | |
currentColorIndex = currentColorIndex % colorCodeArray.Length; | |
string colorName = colorCodeArray[currentColorIndex]; | |
string tagPrefix = GetColorTagPrefix(colorName); | |
string tagPostfix = GetColorTagPostfix(); | |
string outputMsg = $"{tagPrefix}{msg}{tagPostfix}"; | |
// タグをつけたメッセージをコンソールに出力します。 | |
Debug.Log(outputMsg); | |
currentColorIndex++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment