예제 #1
0
    private void GetStoresCatalogDelegate(MeridianData.Stores inStores)
    {
        if (inStores != null)
        {
            stores = inStores;

            foreach (MeridianData.Store store in inStores.storeList)
            {
                OnlineMapsMarker marker = OnlineMaps.instance.AddMarker(float.Parse(store.Longitud), float.Parse(store.Latitud), store.Tienda.TrimEnd());
                marker.scale = 0.5f;

                // uGUICustomMarkerEngineExample.AddMarker(float.Parse(store.Longitud), float.Parse(store.Latitud), store.Tienda.TrimEnd());
            }

            Debug.Log(inStores.storeList.Length + " Stores got");

            UpdateClosestStores(userCoordinates);
        }
    }
예제 #2
0
    private IEnumerator GetStoreCoroutine(int id, SimpleDelegate <MeridianData.Store> getStoreDelegate)
    {
        WWW www = MeridianCommunications.GET("/Catalog/Get/Sucursal/0/ID/" + id);

        yield return(www);

        MeridianData.Stores stores = null;

        if (www.error == null)
        {
            // Since JSon comes in the fom of an array we must wrap data around a class.
            stores = JsonUtility.FromJson <MeridianData.Stores>("{\"storeList\":" + www.text + "}");
        }
        else
        {
            Debug.Log(www.error);
        }

        if (getStoreDelegate != null)
        {
            getStoreDelegate(stores.storeList[0]);
        }
    }