Skip to content

Commit

Permalink
emit error message when an internal depth mask is used but does not h…
Browse files Browse the repository at this point in the history
…ave any renderers
  • Loading branch information
JonnyOThan committed Jul 31, 2024
1 parent 95c942a commit 9fb85d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion FreeIva/InternalModules/InternalModuleFreeIva.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,14 @@ private void OnLoad_DepthMasks()

if (internalDepthMask != null)
{
foreach (var meshRenderer in internalDepthMask.GetComponentsInChildren<MeshRenderer>())
var depthMaskRenderers = internalDepthMask.GetComponentsInChildren<MeshRenderer>();

if (depthMaskRenderers.Length == 0)
{
Debug.LogError($"[FreeIva] INTERNAL '{internalModel.internalName}' internalDepthMask '{internalDepthMaskName}' exists but does not have any mesh renderers");
}

foreach (var meshRenderer in depthMaskRenderers)
{
meshRenderer.sharedMaterial = Utils.GetDepthMaskCullingMaterial();
meshRenderer.gameObject.layer = (int)Layers.InternalSpace;
Expand Down

0 comments on commit 9fb85d0

Please sign in to comment.