Shoot-N-Slash/Assets/Plugins/Core Extensions & Helpers/RendererExtensions.cs
2026-06-04 04:40:36 -07: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);
}
}
}