private void GeneratePlaces(Coordinates currentLocation) { for (int i = 0; i < places.placeList.Count; i++) { PlaceData currentPlace = places.placeList[i]; GameObject temp = Instantiate(objectDatabase[currentPlace.objectModelID].iconObject); temp.name = currentPlace.namaTempat + " _ARZoneIcon"; IconObjectController iconController = temp.GetComponent <IconObjectController>(); if (iconController != null) { iconController.PlaceData = currentPlace; // if (FO.visitedPlace.Contains(currentPlace.namaTempat)) // { // iconController.canBeClicked = false; // } // else // { // iconController.canBeClicked = true; // } } goMap.dropPin(currentPlace.lat, currentPlace.lon, temp); Debug.Log("Dropping pin " + currentPlace.namaTempat); } }
private void ClickHandler() { if (Input.GetMouseButtonDown(0)) { RaycastHit hit = new RaycastHit(); if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit)) { if (hit.collider.gameObject.CompareTag("ARIcon")) { IconObjectController i = hit.collider.GetComponent <IconObjectController>(); if (i != null) { i.OnClicked(); } } } } }