Пример #1
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (poiNameBarScript == null)
     {
         poiNameBarScript = GameObject.Find("POINameBar").GetComponent <PoiNameBarScript>();
     }
     poiNameBarScript.switchBuilding(transform.parent.GetComponent <InvisBuilding>());
     poiNameBarScript.expand();
 }
Пример #2
0
    void Update()
    {
        RaycastHit hit;
        Ray        ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));

        if (Physics.Raycast(ray, out hit))
        {
            Transform objectHit = hit.transform;
            if (objectHit.name.Contains("fade_building"))
            {
                if (poi_name_bar_script.polygon_id != objectHit.GetComponent <InvisBuilding>().id)
                {
                    poi_name_bar_script.switchBuilding(objectHit.GetComponent <InvisBuilding>());
                }
            }
            else if (objectHit.name.Contains("building_icon"))
            {
                if (poi_name_bar_script.polygon_id != objectHit.parent.GetComponent <InvisBuilding>().id)
                {
                    poi_name_bar_script.switchBuilding(objectHit.parent.GetComponent <InvisBuilding>());
                }
            }
            else
            {
                poi_name_bar_script.disableView();
            }
            // Do something with the object that was hit by the raycast.
        }

        //if (Input.GetKeyUp(KeyCode.Escape))
        //{
        //    AndroidJavaClass jc = new AndroidJavaClass("de.mapmo.ARTest.UnityPlayerActivity");
        //    AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("UnityPlayerActivity");
        //    jo.Call("onBackPressed");
        //}
    }