Assets/Deps/emotitron/Utilities/XYZBool.cs
/// <summary>
/// Set position applying ONLY the values indicated as included, non-included axis use the current axis of the gameobject.
/// </summary>
Set position applying ONLY the values indicated as included, non-included axis use the current axis of the gameobject.
Set position applying ONLY the values indicated as included non - included axis use the current axis of the gameobject .
public static void SetPosition(this GameObject go, Vector3 pos, XYZBool includexyz, bool localPosition = false)
	{
		Vector3 newpos = new Vector3(
			(includexyz[0]) ? pos[0] : (localPosition) ? go.transform.localPosition[0] : go.transform.position[0],
			(includexyz[1]) ? pos[1] : (localPosition) ? go.transform.localPosition[1] : go.transform.position[1],
			(includexyz[2]) ? pos[2] : (localPosition) ? go.transform.localPosition[2] : go.transform.position[2]);
		if (!localPosition)
			go.transform.position = newpos;
		else
			go.transform.localPosition = newpos;
	}
public static void SetPosition ( this GameObject go , Vector3 pos , XYZBool includexyz , bool localPosition = false ) { Vector3 newpos = new Vector3 ( ( includexyz [ 0 ] ) ? pos [ 0 ] : ( localPosition ) ? go . transform . localPosition [ 0 ] : go . transform . position [ 0 ] , ( includexyz [ 1 ] ) ? pos [ 1 ] : ( localPosition ) ? go . transform . localPosition [ 1 ] : go . transform . position [ 1 ] , ( includexyz [ 2 ] ) ? pos [ 2 ] : ( localPosition ) ? go . transform . localPosition [ 2 ] : go . transform . position [ 2 ] ) ; if ( ! localPosition ) go . transform . position = newpos ; else go . transform . localPosition = newpos ; }
Set position applying ONLY the values indicated as included, non-included axis use the current axis of the gameobject.
Set position applying ONLY the values indicated as included non - included axis use the current axis of the gameobject .
GameObject
this
pos
Vector3
includexyz
XYZBool
localPosition
bool