public void DeselectEverything() { hexGrid.DeselectAllCells(); unitManager.DeselectAllUnits(); terrainPanel.SetActive(false); if (currentSelectedCell != null) { currentSelectedCell.DeselectCell(); currentSelectedCell = null; } if (currentSelectedCity != null) { currentSelectedCity.DeselectCity(); currentSelectedCity = null; } if (currentSelectedUnit != null) { currentSelectedUnit.DeselectUnit(); currentSelectedUnit = null; } civManager.UnselectAllCities(); hexCamera.UnsetGameObjectToFollow(); }
void Update() { if (isSelected) { if (currentHexCell != null && !currentHexCell.isSelected) { currentHexCell.SelectCell(); } vertical = Input.GetAxis("Vertical"); horizontal = Input.GetAxis("Horizontal"); } else { if (currentHexCell != null && currentHexCell.isSelected) { currentHexCell.DeselectCell(); } } }