[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

@ -13,7 +13,7 @@ public class FPRExclusion : MonoBehaviour
internal List<Transform> affectedChildren = new();
[NonSerialized]
internal ITransformHider[] relevantHiders;
internal readonly List<IFPRExclusionTask> relatedTasks = new();
private void OnEnable()
=> SetFPRState(true);
@ -23,8 +23,13 @@ public class FPRExclusion : MonoBehaviour
private void SetFPRState(bool state)
{
if (relevantHiders == null) return; // no hiders to set
foreach (ITransformHider hider in relevantHiders)
hider.IsActive = state;
if (relatedTasks == null) return; // no hiders to set
foreach (IFPRExclusionTask task in relatedTasks)
task.IsActive = state;
}
}
public interface IFPRExclusionTask
{
public bool IsActive { get; set; }
}