mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
[BetterShadowClone] Throwing on git before i completely overcomplicate and have to revert lmao
This commit is contained in:
parent
d155ea546e
commit
5ee7dca50b
18 changed files with 1697 additions and 0 deletions
30
BetterShadowClone/TransformHider/FPRExclusion.cs
Normal file
30
BetterShadowClone/TransformHider/FPRExclusion.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace NAK.BetterShadowClone;
|
||||
|
||||
/// <summary>
|
||||
/// Manual exclusion component for the TransformHider (FPR) system.
|
||||
/// Allows you to manually hide and show a transform that would otherwise be hidden.
|
||||
/// </summary>
|
||||
public class FPRExclusion : MonoBehaviour
|
||||
{
|
||||
public Transform target;
|
||||
|
||||
internal List<Transform> affectedChildren = new();
|
||||
|
||||
[NonSerialized]
|
||||
internal ITransformHider[] relevantHiders;
|
||||
|
||||
private void OnEnable()
|
||||
=> SetFPRState(true);
|
||||
|
||||
private void OnDisable()
|
||||
=> SetFPRState(false);
|
||||
|
||||
private void SetFPRState(bool state)
|
||||
{
|
||||
if (relevantHiders == null) return; // no hiders to set
|
||||
foreach (ITransformHider hider in relevantHiders)
|
||||
hider.IsActive = state;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue