SingleHandedChef/Assets/Scripts/Helpers.cs
2023-08-20 14:59:02 +05:30

13 lines
477 B
C#

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);
}
}