예제 #1
0
    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;
    }
예제 #2
0
    PlaceListItem AddPlaceListItem(PlaceData data)
    {
        PlaceListItem item = Instantiate(placeItemPrefab, placesHolder)
                             .GetComponent <PlaceListItem>();

        item.Init(data);
        placesShown.Add(item);
        return(item);
    }
예제 #3
0
    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
    }
예제 #4
0
    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;
        }
    }