Comment désactiver tous les autres composants de GameObject dans 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;
}