public GlobeTile CreateTile(Transform parent, Wmts coords)
        {
            GameObject tileGo = Instantiate(tileTemplate);

            tileGo.transform.SetParentClearRelativeTransform(parent);
            tileGo.name = coords.ToString();

            GlobeTile tile = tileGo.GetComponent <GlobeTile>();

            tile.coords = coords;
            tile.globe  = globe;
            tile.bBox   = Layer.Wmts2DefaultBbox(coords);
            tile.SetVisible(false);
            return(tile);
        }
Exemple #2
0
        // TODO should use TileFactory
        private GlobeTile CreateTile(Transform parent, Wmts coords)
        {
            GameObject tileGo = Instantiate(tileTemplate);

            // high level tile mesh needs to be scaled for radius of globe -pete
            tileGo.transform.SetParentClearRelativeTransform(parent.transform, Vector3.zero, Quaternion.identity, Vector3.one * 0.5f);
            tileGo.name = coords.ToString();

            GlobeTile tile = tileGo.GetComponent <GlobeTile>();

            tile.coords = coords;
            tile.globe  = this;
            tile.bBox   = CurrentLayer.Wmts2Bbox(coords);

            return(tile);
        }
        private void CreateTile(GlobeTile parent, Wmts coords)
        {
            GameObject tileGo = Instantiate(tileTemplate);

            tileGo.transform.SetParentClearRelativeTransform(parent.transform);
            tileGo.name = coords.ToString();

            GlobeTile tile = tileGo.GetComponent <GlobeTile>();

            tile.coords = coords;
            tile.globe  = globe;
            tile.bBox   = globe.CurrentLayer.Wmts2Bbox(coords);

            tile.SetVisible(false);

            parent.AddChild(tile);
        }