ソースコード
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 ); } } }