/// <summary> /// Gets the position as sphere coordinate. /// Better to use this method only once a manipulate the returned object, unless the center is changed. /// </summary> /// <returns>The position as a SphereCoordinate</returns> /// <param name="center">The referenceCenter.</param> public static SphereCoordinate GetSpherePosition(this Transform transform, Vector3 center) { var sphere = new SphereCoordinate(transform.position - center); //Debug.Log( sphere.ToString() ); return(sphere); }
public static void SetSpherePosition(this Transform transform, SphereCoordinate coordinate) { SetSpherePosition(transform, coordinate, new Vector3(0, 0, 0)); }
public static void SetSpherePosition(this Transform transform, SphereCoordinate coordinate, Vector3 center) { //Debug.Log( coordinate.ToString() ); transform.position = coordinate.ToVector3() + center; }