private float GetRotation(Vector3 segDir) { float a1 = Mathf.Atan2 (segDir.x, segDir.y) * Mathf.Rad2Deg; a1 += a1 < 0 ? 360 : 0; return a1; }