以下の内容はhttps://baba-s.hatenablog.com/entry/2023/04/25/085655より取得しました。


【Unity】TextId 型の拡張メソッド

ソースコード

using TMPro;

namespace Kogane
{
    // ReSharper disable once InconsistentNaming
    public static class TMP_TextTextIdExtensionMethods
    {
        public static void SetText
        (
            this TMP_Text self,
            TextId        textId
        )
        {
            self.text = textId.Value;
        }

        public static void SetText<T>
        (
            this TMP_Text self,
            TextId        textId,
            T             arg1
        )
        {
            self.text = textId.FormatWith( arg1 );
        }

        public static void SetText<T1, T2>
        (
            this TMP_Text self,
            TextId        textId,
            T1            arg1,
            T2            arg2
        )
        {
            self.text = textId.FormatWith( arg1, arg2 );
        }

        public static void SetText<T1, T2, T3>
        (
            this TMP_Text self,
            TextId        textId,
            T1            arg1,
            T2            arg2,
            T3            arg3
        )
        {
            self.text = textId.FormatWith( arg1, arg2, arg3 );
        }

        public static void SetText<T1, T2, T3, T4>
        (
            this TMP_Text self,
            TextId        textId,
            T1            arg1,
            T2            arg2,
            T3            arg3,
            T4            arg4
        )
        {
            self.text = textId.FormatWith( arg1, arg2, arg3, arg4 );
        }
    }
}

リポジトリ




以上の内容はhttps://baba-s.hatenablog.com/entry/2023/04/25/085655より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14