Created
December 5, 2016 00:39
-
-
Save peroon/25baa5818c99dc12517cdc89616eaaf7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using UnityEngine; | |
| using System; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| namespace DL | |
| { | |
| /// <summary> | |
| /// MonoBehaviourの拡張クラス | |
| /// </summary> | |
| public static partial class Extensions | |
| { | |
| /// <summary> | |
| /// 指定した色の着色情報をつける | |
| /// </summary> | |
| /// <param name="color">色文字列</param> | |
| /// <returns><カラー付与出力文字列/returns> | |
| public static string Coloring(this string iSelf , string iColor) | |
| { | |
| return string.Format("<color={0}>{1}</color>" , iColor , iSelf); | |
| } | |
| /// <summary> | |
| /// 赤色の着色情報をつける | |
| /// </summary> | |
| /// <param name="iString">入力文字列</param> | |
| /// <returns><カラー付与出力文字列/returns> | |
| public static string Red(this string iSelf) | |
| { | |
| return iSelf.Coloring("red"); | |
| } | |
| /// <summary> | |
| /// 緑色の着色情報をつける | |
| /// </summary> | |
| /// <returns>カラー付与出力文字列</returns> | |
| public static string Green(this string iSelf) | |
| { | |
| return iSelf.Coloring("green"); | |
| } | |
| /// <summary> | |
| /// 青色の着色情報をつける | |
| /// </summary> | |
| /// <returns>カラー付与出力文字列</returns> | |
| public static string Blue(this string iSelf) | |
| { | |
| return iSelf.Coloring("blue"); | |
| } | |
| /// <summary> | |
| /// シアン色の着色情報をつける | |
| /// </summary> | |
| /// <returns>カラー付与出力文字列</returns> | |
| public static string Cyan(this string iSelf) | |
| { | |
| return iSelf.Coloring("cyan"); | |
| } | |
| /// <summary> | |
| /// マゼンタ色の着色情報をつける | |
| /// </summary> | |
| /// <returns>カラー付与出力文字列</returns> | |
| public static string Magenta(this string iSelf) | |
| { | |
| return iSelf.Coloring("magenta"); | |
| } | |
| /// <summary> | |
| /// 黄色の着色情報をつける | |
| /// </summary> | |
| /// <returns>カラー付与出力文字列</returns> | |
| public static string Yellow(this string iSelf) | |
| { | |
| return iSelf.Coloring("yellow"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment