Exemplo n.º 1
0
    public void ClickedOnTile()
    {
        //		 audio.PlayOneShot(click);
        //Debug.Log("click");
        //Debug.Log("Clicked on a tile. Tile is active: " + tileActive.ToString());

        /*
         * if there is a chit on this tile,
         * and it is within range...
         */
        if (chitOnTile != null)
        {
            switch (chitOnTile.ctype)
            {
            case ChitTypes.CITY:
                City city = chitOnTile.GetComponent <City>();
                transform.parent.GetComponent <Planet>().ui.DisplayCityInfo(city);
                break;

            case ChitTypes.SWORD:
                ClickedOnATileWithAChit();
                break;

            default:
                break;
            }
        }

        /*
         * if there isn't a chit on this tile, but we have previously selected a chit
         * then move that chit to this tile
         */
        else
        {
//			Debug.Log("no chit on tile");
            ClickedOnAnEmptyTile();
        }
    }