ソースコード
using UnityEngine; public static class Vector4Ext { public static void Deconstruct ( this Vector4 self, out float x, out float y, out float z, out float w ) { x = self.x; y = self.y; z = self.z; w = self.w; } }
使用例
通常
var vec = new Vector4( 1, 2, 3, 4 );
Deconstruction
var ( x, y, z, w ) = new Vector4( 1, 2, 3, 4 );