using UnityEngine; // Attacher sur le GameObject "Selection Panel" (enfant de SETDIM). // Gère la visibilité des 4 boutons selon l'état courant. public class SelectionPanelUI : MonoBehaviour { [Header("Boutons")] [SerializeField] private GameObject _btnAddWall; [SerializeField] private GameObject _btnDelete; [SerializeField] private GameObject _btnRecenter; [SerializeField] private GameObject _btnRestart; public void OnRestartClick() { WallCreationManager.RestartPlan(); } void Update() { bool hasSelection = WallSelection.TryGetCurrentSelection(out _); bool isDrawPlan = _G.ROOM == "R11" || _G.ROOM == "RDRAW"; if (_btnRecenter != null) _btnRecenter.SetActive(true); if (_btnAddWall != null) _btnAddWall .SetActive(hasSelection); if (_btnDelete != null) _btnDelete .SetActive(hasSelection); if (_btnRestart != null) _btnRestart .SetActive(isDrawPlan); } }