Everyone who coded for Unity3D has come across this problem; Print a Vector3 and get this:
(1.2, 0.0, 2.0)
With the help of an extension-class we can fix this by adding a function to the Vector3 struct:
using UnityEngine;
public static class Vector3Extension
{
public static void print(this Vector3 _vector)
{
Debug.Log("(" + _vector.x.ToString("0.0#######") + ", " + _vector.y.ToString("0.0#######") + ", " + _vector.z.ToString("0.0#######") + ")");
}
}
aVector.print();
(1.23, 0.0, 1.987387)