public static Axis GetAxisToDirection(Transform t, Vector3 direction) { Vector3 axisVectorToDirection = AxisTools.GetAxisVectorToDirection(t, direction); if (axisVectorToDirection == Vector3.right) { return(Axis.X); } if (axisVectorToDirection == Vector3.up) { return(Axis.Y); } return(Axis.Z); }
public static Axis GetAxisToPoint(Transform t, Vector3 worldPosition) { Vector3 axisVectorToPoint = AxisTools.GetAxisVectorToPoint(t, worldPosition); if (axisVectorToPoint == Vector3.right) { return(Axis.X); } if (axisVectorToPoint == Vector3.up) { return(Axis.Y); } return(Axis.Z); }
public static Vector3 GetAxisVectorToPoint(Transform t, Vector3 worldPosition) { return(AxisTools.GetAxisVectorToDirection(t, worldPosition - t.position)); }