Disable FurShellRenderer globally (not production-ready yet)
IsGloballyEnabled() kill switch: Awake destroys the component at runtime, OnEnable self-disables in the editor. Flip the constant to re-enable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0541a6416f
commit
39ab1a3ced
1 file changed
+19
@@ -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<MeshFilter>();
|
||||
// On a skinned avatar the fur borrows this component's per-frame baked pose instead of a
|
||||
// static MeshFilter mesh (see ResolveMesh).
|
||||
|
||||
Reference in new issue
Block a user