public void Load(PlaceListItem place) { if (currentPlace != place) { IsLoading = true; currentPlace = place; title.text = place.data.placeDetails.result.name; Destroy(currentPhoto.sprite); currentPhoto.color = Color.clear; UpdateLabels(place.data.place); UpdateArrivalTime(place.data.place); OnToggleArrivalContent(false); OnToggleLabelsContent(false); photoHolder.SetActive(false); StartCoroutine(GetPhotos(place.data.place.googleid)); StartCoroutine(GetDetails(place.data.place.googleid)); } else { IsLoading = false; Sidebar.Instance.GoToPage(Sidebar.Page.PlaceDetails); } title.rectTransform.sizeDelta = title.rectTransform.sizeDelta.SetY(title.preferredHeight); GetComponentInChildren <ScrollRect>().verticalScrollbar.value = 1; }
PlaceListItem AddPlaceListItem(PlaceData data) { PlaceListItem item = Instantiate(placeItemPrefab, placesHolder) .GetComponent <PlaceListItem>(); item.Init(data); placesShown.Add(item); return(item); }
public void OnClickPlaceItem(PlaceListItem item) { if (item.data.placeDetails != null) { MapCamera.Instance.SetCameraViewport(item.data.placeDetails.result.geometry); } placeDetailsPage.Load(item); // Place Details Page will call GoToPage }
IEnumerator EditPlaceCoroutine(PlaceListItem place) { string url = EditPlaceResult.BuildURL(place.data.place); WWW www = new WWW(url); yield return(www); if (www.error != null) { Debug.Log(www.error); yield break; } EditPlaceResult result = JsonUtility.FromJson <EditPlaceResult>(www.text); if (result.error != null) { Debug.Log(result.error); yield break; } }