Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created September 12, 2021 15:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save todorok1/d56d1b239c030c11ede22fc435eb397b to your computer and use it in GitHub Desktop.
ゲーミングDebug.Logのサンプルメソッド
/// <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