Beispiel #1
0
        public static Vector3 FocusSphere(this UnityEngine.Camera camera, GameObject go)
        {
            var bounds   = go.GetCompositeRendererBounds();
            var position = bounds.center;

            // Get the radius of a sphere circumscribing the bounds
            var radius = bounds.size.magnitude / 2;

            return(camera.FocusSphere(position, radius));
        }