using System.Collections; using System.Collections.Generic; using UnityEngine; public static class GenericExtensions{ public static Vector3 with (this Vector3 v, float? x = null, float? y=null, float? z=null){ return new Vector3(x ?? v.x, y ?? v.y, z ?? v.z); } public static Quaternion with (this Quaternion v, float? x = null, float? y=null, float? z=null, float? w = null){ return new Quaternion(x ?? v.x, y ?? v.y, z ?? v.z, w ?? v.w); } }