internal void Initialize(IMap map, UnwrappedTileId tileId) { _relativeScale = 1 / Mathf.Cos(Mathf.Deg2Rad * (float)map.CenterLatitudeLongitude.x); _rect = Conversions.TileBounds(tileId); _unwrappedTileId = tileId; _canonicalTileId = tileId.Canonical; gameObject.name = _canonicalTileId.ToString(); var position = new Vector3((float)(_rect.Center.x - map.CenterMercator.x), 0, (float)(_rect.Center.y - map.CenterMercator.y)); transform.localPosition = position; gameObject.SetActive(true); }
public void SetTileId(CanonicalTileId id) { this.id = id; obj = GameObject.CreatePrimitive(PrimitiveType.Plane); obj.hideFlags = HideFlags.DontSave; obj.name = id.ToString(); obj.transform.localRotation = Quaternion.Euler(90, 0, 180); if (Application.isPlaying) { obj.GetComponent <MeshRenderer>().enabled = false; } }