Jak wyłączyć wszystkie inne komponenty w GameObject w Unity
foreach (MonoBehaviour component in GetComponents<MonoBehaviour>())
{
if (component != this) component.enabled = false;
}
foreach (MonoBehaviour component in GetComponents<MonoBehaviour>())
{
if (component != this) component.enabled = false;
}