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


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

ソースコード

using TMPro;
using UnityEngine;
using UnityEngine.UI;

namespace Kogane
{
    public static class GraphicExtensionMethods
    {
        public static void SetColorIfNotNull( this Graphic self, in Color color )
        {
            if ( self == null ) return;
            self.color = color;
        }

        public static void SetColorWithoutAlphaIfNotNull( this Graphic self, in Color color )
        {
            if ( self == null ) return;

            self.color = new
            (
                r: color.r,
                g: color.g,
                b: color.b,
                a: self.color.a
            );
        }
    }
}



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

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