public void PanelToggel() { if (panel != null) { bool isActive = panel.activeSelf; if (buildingSystem.currentPlaceableObject != null) { buildingSystem.ClearCurser(); } panel.GetComponent <BuildingMenuButtonManagment>().UpdateButtons(); panel.SetActive(!isActive); } }