コード例 #1
0
    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();
    }
コード例 #2
0
    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();
            }
        }
    }