Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonUp(0))
        {
            ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray, out hit, 5000))
            {
                Debug.Log(hit.transform.tag);
                switch (hit.transform.tag)
                {
                case "ingredient":
                {
                    hit.transform.GetComponent <ClickedIngredient>().IsClicked();
                    break;
                }

                case "store":
                {
                    ClickedStore store = hit.transform.GetComponent <ClickedStore>();
                    popup.DisplayStore(store.storeName, store.storeLocation);
                    break;
                }
                }
            }
        }
    }
Example #2
0
    public void SpawnPOIAtLocation(SnapLocation _snap, double lat, double lon)
    {
        var map = LocationProviderFactory.Instance.mapManager;

        if (_snap.city.ToLower().Equals("orlando"))
        {
            Debug.Log(_snap.storeName);
            Vector2d loc = new Vector2d(lat, lon);
            currentIndex++;
            GameObject store = Instantiate(storePrefab);
            store.transform.localPosition = _map.GeoToWorldPosition(loc, true);
            store.transform.localScale    = new Vector3(1, 1, 1);
            ClickedStore cstore = store.AddComponent <ClickedStore>();
            cstore.storeName     = _snap.storeName;
            cstore.storeLocation = _snap.streetAddress;
            Debug.Log(currentIndex);
        }
    }