using UnityEngine;
namespace NAK.BetterShadowClone;
///
/// Manual exclusion component for the TransformHider (FPR) system.
/// Allows you to manually hide and show a transform that would otherwise be hidden.
///
public class FPRExclusion : MonoBehaviour
{
public Transform target;
internal readonly List affectedVertexIndices = new();
internal readonly List affectedChildren = new();
internal readonly List relatedTasks = new();
private void OnEnable()
=> SetFPRState(true);
private void OnDisable()
=> SetFPRState(false);
private void SetFPRState(bool 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; }
}