Esempio n. 1
0
    public void RemoveTile(TileManager tile)
    {
        tile.district = null;
        tiles.Remove(tile);

        TallyVotes();

        tile.display.DrawTile();
        DrawHighlights();

        if (tiles.Count == 0)
        {
            Destroy(gameObject);
        }

        FindObjectOfType <ScoreDisplay> ().DrawScores();

        SelectionManager.CheckRules();

        GetComponent <TextMesh> ().text = tiles.Count.ToString();

        if (tiles.Count < grid.districtSize)
        {
            GetComponent <MeshRenderer> ().enabled = true;
        }
        else
        {
            GetComponent <MeshRenderer> ().enabled = false;
        }
    }
Esempio n. 2
0
    public void AddTile(TileManager tile)
    {
        if (!tiles.Contains(tile))
        {
            tile.district = this;
            tiles.Add(tile);
        }

        TallyVotes();
        DrawHighlights();

        FindObjectOfType <ScoreDisplay> ().DrawScores();

        SelectionManager.CheckRules();

        GetComponent <TextMesh> ().text = tiles.Count.ToString();

        if (tiles.Count < grid.districtSize)
        {
            GetComponent <MeshRenderer> ().enabled = true;
        }
        else
        {
            GetComponent <MeshRenderer> ().enabled = false;
        }
    }