LunarInfantry/Assets/Core Extensions & Helpers/RendererExtensions.cs
2026-01-02 01:31:54 -08:00

15 lines
405 B
C#
Executable file

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Core.Extensions
{
public static class RendererExtensions
{
public static bool IsVisible(this Renderer r, Camera c)
{
Plane[] planes = GeometryUtility.CalculateFrustumPlanes(c);
return GeometryUtility.TestPlanesAABB(planes, r.bounds);
}
}
}