diff --git a/Assets/Scripts/Components/FurShellRenderer.cs b/Assets/Scripts/Components/FurShellRenderer.cs index dc1a4c4..a077799 100644 --- a/Assets/Scripts/Components/FurShellRenderer.cs +++ b/Assets/Scripts/Components/FurShellRenderer.cs @@ -19,6 +19,8 @@ namespace Chameleon.Components [ExecuteAlways] public sealed class FurShellRenderer : MonoBehaviour { + public static bool IsGloballyEnabled() => false; + [Header("Shells")] [SerializeField] Material _furMaterial; [SerializeField, Range(1, 64)] int _shellCount = 32; @@ -143,8 +145,25 @@ namespace Chameleon.Components Matrix4x4[] _instances; MaterialPropertyBlock _mpb; + void Awake() + { + if (IsGloballyEnabled()) + { + enabled = true; + return; + } + + Destroy(this); + } + void OnEnable() { + if (!IsGloballyEnabled()) + { + enabled = false; + return; + } + _meshFilter = GetComponent(); // On a skinned avatar the fur borrows this component's per-frame baked pose instead of a // static MeshFilter mesh (see ResolveMesh).