[BetterShadowClone] holyshit i overcomplicated it

This commit is contained in:
NotAKidoS 2024-02-03 03:28:59 -06:00
parent 1de39260f4
commit c4099d90a0
5 changed files with 155 additions and 123 deletions

View file

@ -4,7 +4,7 @@ using UnityEngine.Rendering;
namespace NAK.BetterShadowClone;
public class MeshTransformHider : ITransformHider
public class MeshTransformHider : ITransformHider, IFPRExclusionTask
{
// lame 2 frame init stuff
private const int FrameInitCount = 0;
@ -23,8 +23,19 @@ public class MeshTransformHider : ITransformHider
// anything player can touch is suspect to death
public bool IsValid => _mainMesh != null && !_markedForDeath;
public MeshTransformHider(MeshRenderer renderer)
public MeshTransformHider(MeshRenderer renderer, IReadOnlyDictionary<Transform, FPRExclusion> exclusions)
{
Transform rootBone = renderer.transform;
// if no key found, dispose
if (!exclusions.TryGetValue(rootBone, out FPRExclusion exclusion))
{
Dispose();
return;
}
exclusion.relatedTasks.Add(this);
_mainMesh = renderer;
if (_mainMesh == null