示例#1
0
	public void activate(TileCluster tc){
		IVector2 pos = new IVector2(this.transform.position.x,this.transform.position.y);
		Map map = GameObject.FindObjectOfType<Map>();
		TileCluster t = tc.copy();
		t.x += pos.x;
		t.y += pos.y;
		map.populateCluster(t);
	}
示例#2
0
    public void activate(TileCluster tc)
    {
        IVector2    pos = new IVector2(this.transform.position.x, this.transform.position.y);
        Map         map = GameObject.FindObjectOfType <Map>();
        TileCluster t   = tc.copy();

        t.x += pos.x;
        t.y += pos.y;
        map.populateCluster(t);
    }
示例#3
0
    public void draw()
    {
        Map         m   = GameObject.FindObjectOfType <Map>();
        IVector2    pos = new IVector2(this.transform.position.x, this.transform.position.y);
        TileCluster t   = towerCluster.copy();

        for (int x = t.x; x < t.x + t.width; x++)
        {
            for (int y = t.y; y < t.y + t.height + 2; y++)
            {
                if (Random.value < t.likeliness)
                {
                    m.setTile(new IVector2(pos.x + x, pos.y + y), (byte)0, (byte)TileSpecList.getTileSpecInt(towerCluster.tileType));
                }
            }
        }
    }