Assets/Deps/emotitron/Utilities/XYZBool.cs
/// <summary>
/// Lerp extension that only applies the lerp to axis indicated by the XYZ. Other axis return the same axis value as start.
/// </summary>
Lerp extension that only applies the lerp to axis indicated by the XYZ. Other axis return the same axis value as start.
Lerp extension that only applies the lerp to axis indicated by the XYZ . Other axis return the same axis value as start .
public static Vector3 Lerp(this GameObject go, Vector3 start, Vector3 end, XYZBool includexyz, float t, bool localPosition = false)
	{
		Vector3 rawLerpedPos = Vector3.Lerp(start, end, t);
		return new Vector3(
			(includexyz[0]) ? rawLerpedPos[0] : ((localPosition) ? go.transform.localPosition[0] : go.transform.position[0]),
			(includexyz[1]) ? rawLerpedPos[1] : ((localPosition) ? go.transform.localPosition[1] : go.transform.position[1]),
			(includexyz[2]) ? rawLerpedPos[2] : ((localPosition) ? go.transform.localPosition[2] : go.transform.position[2]));
	}
public static Vector3 Lerp ( this GameObject go , Vector3 start , Vector3 end , XYZBool includexyz , float t , bool localPosition = false ) { Vector3 rawLerpedPos = Vector3 . Lerp ( start , end , t ) ; return new Vector3 ( ( includexyz [ 0 ] ) ? rawLerpedPos [ 0 ] : ( ( localPosition ) ? go . transform . localPosition [ 0 ] : go . transform . position [ 0 ] ) , ( includexyz [ 1 ] ) ? rawLerpedPos [ 1 ] : ( ( localPosition ) ? go . transform . localPosition [ 1 ] : go . transform . position [ 1 ] ) , ( includexyz [ 2 ] ) ? rawLerpedPos [ 2 ] : ( ( localPosition ) ? go . transform . localPosition [ 2 ] : go . transform . position [ 2 ] ) ) ; }
Lerp extension that only applies the lerp to axis indicated by the XYZ.
Lerp extension that only applies the lerp to axis indicated by the XYZ .
// the lerped position, not accounting for any axis that are not included // for non-included axis, use the current postion
GameObject
this
start
Vector3
end
Vector3
includexyz
XYZBool
t
float
localPosition
bool