ソースコード
using UnityEngine; public static class ColorExt { public static void Deconstruct ( this Color self, out float r, out float g, out float b ) { r = self.r; g = self.g; b = self.b; } public static void Deconstruct ( this Color self, out float r, out float g, out float b, out float a ) { r = self.r; g = self.g; b = self.b; a = self.a; } }
使用例
通常
var col = Color.white;
Deconstruction
var ( r, g, b ) = Color.white; var ( r, g, b, a ) = Color.white;