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); }
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); }
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)); } } } }