void Update_Distance() { if (unit == PREFIX.AU) { MULT = 0.01f; } if (unit == PREFIX.PK) { MULT = 0.0000001f; } if ((int)distance == 149597871 && unit == PREFIX.KM) { distance = 1; unit = PREFIX.AU; Debug.Log("changed"); } /*if (distance >= 206264.806f && unit == PREFIX.AU) * { * distance /= 206264.806f; * unit = PREFIX.PK; * }*/ distance += GetComponent <SU_CameraFollow>().target.GetComponent <Rigidbody>().velocity.magnitude *Time.deltaTime *MULT; distance_text.text = System.String.Format("{0:F0} {1}", distance, unit.ToString()); }