public void AddToPOI(double lat, double lon, int id, GameObject gameObject, float heading) { POICoordinatesObject POI = new POICoordinatesObject(lat, lon, gameObject, heading); PoiCoordinatesObjects.Add(key, POI); key++; }
public void addQuery(POICoordinatesObject poiCoordinatesObject) { view.setVisibility(true); view.createSelection(poiCoordinatesObject); querylist.Add(poiCoordinatesObject); FilterData(poiCoordinatesObject); }
public GameObject RenderGameObject(POICoordinatesObject poiCoordinatesObject) { GameObject ShowPicture = poiCoordinatesObject.GETGameObject(); ShowPicture = Instantiate(ShowPicture); ShowPicture.transform.localScale = new Vector3(0.3f, 0.15f, 0.004f); ShowPicture.transform.position = Camera.main.transform.position + new Vector3(0, 0, 0.5f); ShowPicture.AddComponent <ObjectManipulator>(); ShowPicture.AddComponent <NearInteractionGrabbable>(); if (spawnedObject_counter == 0) { Arrow.SetActive(true); Arrow.GetComponent <DirectionalIndicator>().DirectionalTarget = ShowPicture.transform; } Arrow.SetActive(true); Arrow.GetComponent <DirectionalIndicator>().DirectionalTarget = ShowPicture.transform; GetHeading(ShowPicture, poiCoordinatesObject.getHeading()); //Vector3 difference = new Vector3(raw_diff.x,0,raw_diff.y); //CalculateBearing(poiCoordinatesObject.getHeading(),ShowPicture); ShowPicture.transform.parent = transform.parent; //ShowPicture.transform.position = transform.GetChild(9).position; ShowPicture.SetActive(true); //GameObject ShowPictureOption = (GameObject)Resources.Load("Prefab/ShowResult",typeof(GameObject)) ; //ShowPictureOption = Instantiate(ShowPictureOption); //Texture texture = await ResultPanelView.GetRemoteTexture(poiCoordinatesObject.getURL()); //ShowPicture.GetComponent<Renderer>().sharedMaterial.mainTexture = texture; //ShowPicture.transform.SetParent(transform); SpawnedObjects.Add(poiCoordinatesObject, ShowPicture); spawnedObject_counter++; return(ShowPicture); }
private void OnQueryRemoveButtonLogic(GameObject POIButton, POICoordinatesObject poiCoordinatesObject) { int ID = POIButton.GetComponent <ButtonAttribute>().getID(); queryList.Remove(ID); int buttonID = POIButton.GetComponent <ButtonAttribute>().getID(); Debug.Log("Destroying POIButton " + buttonID); scrollingObjectCollection.RemoveItem(POIButton); Destroy(POIButton); scrollingObjectCollection.UpdateCollection(); var eventArgs = new QueryRemoveEventArgs(); eventArgs.RemoveObject = poiCoordinatesObject.getMapPin(); eventArgs.poi = poiCoordinatesObject; OnRemove(this, eventArgs); // foreach (Transform VARIABLE in transform.GetChild(4).GetChild(1).GetChild(0)) // { // if (id == VARIABLE.gameObject.GetComponent<ButtonAttribute>().getID()) // { // if (VARIABLE.gameObject != null) // { // Destroy(VARIABLE.gameObject); // Invoke("updatePOIButtonCollection",0.5f); // } // return; // } // } }
public void FilterData(POICoordinatesObject poiCoordinatesObject) { if (poiCoordinatesObject.getMyLocation()) { myLocation = poiCoordinatesObject.getCoordinates(); } else { PointOfInterests.Add(poiCoordinatesObject.getCoordinates()); } }
public void Zoom() { //var mapScene = new MapSceneOfLocationAndZoomLevel(_mapPin.Location, _map.ZoomLevel + 1.01f); //_map.SetMapScene(mapScene); string name = _mapPin.transform.GetChild(0).GetChild(0).gameObject.GetComponent <TextMeshPro>().text; POICoordinatesObject poiCoordinatesObject = new POICoordinatesObject(_mapPin.Location.LatitudeInDegrees, _mapPin.Location.LongitudeInDegrees, name, transform.gameObject, "https://cdn.pixabay.com/photo/2018/09/23/18/30/drop-3698073_960_720.jpg"); Debug.Log("zoom: " + poiCoordinatesObject.getCoordinates()); var eventArgs = new POIEventArgs(poiCoordinatesObject); // Dispatch the 'position changed' event OnMapObject(this, eventArgs); }
private void HandleCPositionSelect(object sender, QueryOptionEventArgs e) { IGPSLoggerModel gpsLoggerModel = transform.GetComponent <GPSLoggerController>().GETGPSLoggerModel(); //Needs function to wait until gps signal is available // model.setQueryData(gpsLoggerModel.getStringGPSCoordinates()); QueryMenuController IqueryMenuView = transform.GetComponent <QueryMenuController>(); POICoordinatesObject poiCoordinatesObject = new POICoordinatesObject(gpsLoggerModel.getLatitude(), gpsLoggerModel.getLongitude(), gpsLoggerModel.getHeading()); poiCoordinatesObject.setMyLocation(true); poiCoordinatesObject.setName("My Location: " + poiCoordinatesObject.getCoordinates()); IqueryMenuView.addQuery(poiCoordinatesObject); }
private void GenerateLatLonObject(LatLonAlt data) { var mapPin = Instantiate(_mapPinPrefab); mapPin.Location = data.LatLon; _mapPinLayer.MapPins.Add(mapPin); POICoordinatesObject poiCoordinatesObject = new POICoordinatesObject(data.LatitudeInDegrees, data.LongitudeInDegrees, 0); poiCoordinatesObject.setMapPin(mapPin); poiCoordinatesObject.setName(data.LatLon.LatitudeInDegrees.ToString() + " " + data.LongitudeInDegrees); var EventArgs = new POIEventArgs(poiCoordinatesObject); OnPOI(this, EventArgs); }
public void createSelection(POICoordinatesObject poiCoordinatesObject) { GameObject POIButton = (GameObject)Resources.Load("Prefab/POIButton", typeof(GameObject)); POIButton = Instantiate(POIButton); POIButton.transform.rotation = transform.rotation; POIButton.GetComponent <ButtonConfigHelper>().MainLabelText = poiCoordinatesObject.ToString(); POIButton.GetComponent <ButtonAttribute>().setID_coordinates(ButtonID, poiCoordinatesObject); POIButton.GetComponent <Interactable>().OnClick.AddListener((() => OnQueryRemoveButtonLogic(POIButton, poiCoordinatesObject))); POIButton.gameObject.transform.parent = transform.GetChild(2).GetChild(0); queryList[ButtonID] = POIButton; ButtonID++; scrollingObjectCollection.UpdateCollection(); }
public void destroyRenderedObject(GameObject activeObject, POICoordinatesObject poiCoordinatesObject) { ActiveList.Remove(activeObject); SpawnedObjects.Remove(poiCoordinatesObject); foreach (Transform objects in transform.parent) { if (objects.gameObject == activeObject) { Destroy(objects.gameObject); break; } } Debug.Log("Unloaded spawned Object"); }
public void RemoveGameObject(POICoordinatesObject poiCoordinatesObject) { GameObject gameObject = SpawnedObjects[poiCoordinatesObject]; Arrow.GetComponent <DirectionalIndicator>().DirectionalTarget = null; Arrow.SetActive(false); foreach (Transform VARIABLE in transform) { if (VARIABLE.gameObject == gameObject) { Destroy(VARIABLE.gameObject); break; } } Debug.Log("Deleted Object"); if (spawnedObject_counter == 1) { Arrow.SetActive(false); spawnedObject_counter--; } }
public void setID_coordinates(int id, POICoordinatesObject poiCoordinatesObject) { this.id = id; this.poiCoordinatesObject = poiCoordinatesObject; }
public POIEventArgs(POICoordinatesObject poiCoordinatesObject) { this.poiCoordinatesObject = poiCoordinatesObject; }
public void AddPOIQuery(POICoordinatesObject poiCoordinatesObject) { view.createSelection(poiCoordinatesObject); }
public SpawnObjectOnCoordinateEventArgs(POICoordinatesObject poiCoordinatesObject) { this.poiCoordinatesObject = poiCoordinatesObject; }
public void AddPOILocation(POICoordinatesObject poiCoordinatesObject) { poiLocations.Add(POIGameObjectID, poiCoordinatesObject); POIGameObjectID++; }