using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
namespace MoreMountains.Tools
{
///
/// Renderer extensions
///
public static class RendererExtensions
{
///
/// Returns true if a renderer is visible from a camera
///
///
///
///
public static bool MMIsVisibleFrom(this Renderer renderer, Camera camera)
{
Plane[] frustumPlanes = GeometryUtility.CalculateFrustumPlanes(camera);
return GeometryUtility.TestPlanesAABB(frustumPlanes, renderer.bounds);
}
}
}