// Pass trail name and user location to start getting directions for the trail void getTrailByName(string trailName, Location userLoc) { if (directionHandler == null) { directionHandler = (DirectionsHandler)directionsObject.GetComponent(typeof(DirectionsHandler)); } if (wwwScript == null && wwwHandler != null) { wwwScript = (WWWHandler)wwwHandler.GetComponent(typeof(WWWHandler)); } directionHandler.StartCoroutine(directionHandler.getDirectionsFromTrailName(wwwScript, trailName, userLoc)); }
void Start() { //object that updates camera position based on player position StartCoroutine(setPositionOnVuforiaEnabled()); //get reference to WWWHandler and get server data and parse it if (wwwHandler != null) { wwwScript = (WWWHandler)wwwHandler.gameObject.GetComponent(typeof(WWWHandler)); } //get reference to map handler script if (mapObject != null) { map = (Mapbox.Unity.Map.AbstractMap)mapObject.GetComponent((typeof(Mapbox.Unity.Map.AbstractMap))); } if (directionsObject != null) { directionHandler = (DirectionsHandler)directionsObject.GetComponent(typeof(DirectionsHandler)); } if (annotationObject != null) { annotationHandler = (AnnotationHandler)annotationObject.GetComponent(typeof(AnnotationHandler)); } if (uiObject != null) { uiHandler = (UIManager)uiObject.GetComponent(typeof(UIManager)); } if (playerObject == null) { playerObject = GameObject.FindGameObjectWithTag("Player"); } if (playerLocation == null) { playerLocation = GameObject.FindGameObjectWithTag("playerLocation"); } if (cameraPosition == null) { cameraPosition = GameObject.FindGameObjectWithTag("cameraPosition"); } StartCoroutine(directionHandler.waitForMapLoad()); nextPlayerPosition = playerObject.transform.localPosition; }
void Start() { billboards = new ArrayList(); if (wwwHandler != null) { wwwScript = (WWWHandler)wwwHandler.gameObject.GetComponent(typeof(WWWHandler)); } if (directionsObject != null) { directionsHandler = (DirectionsHandler)directionsObject.GetComponent(typeof(DirectionsHandler)); } if (sceneObject != null) { sceneHandler = (SceneManager)sceneObject.GetComponent(typeof(SceneManager)); } }
void getTestDirectionsFromLocation(Location location) { if (true) { if (directionsObject == null) { directionsObject = GameObject.FindGameObjectWithTag("DirectionsObject"); } if (directionHandler == null) { directionHandler = (DirectionsHandler)directionsObject.GetComponent(typeof(DirectionsHandler)); } if (wwwScript == null && wwwHandler != null) { wwwScript = (WWWHandler)wwwHandler.GetComponent(typeof(WWWHandler)); } directionHandler.StartCoroutine(directionHandler.getTestDirectionsFromJSON(wwwScript, location)); } }
void Start() { resultList = new List <GameObject> (); nearbyTrails = new List <string[]> (); trailNames = new List <string> (); searchScrollView.gameObject.SetActive(false); annotationInput.gameObject.SetActive(false); if (cameraObject != null) { cameraHandler = (CameraHandler)cameraObject.gameObject.GetComponent(typeof(CameraHandler)); } if (camera2D != null) { quadTreeCameraMovement = (Mapbox.Examples.QuadTreeCameraMovement)camera2D.GetComponent(typeof(Mapbox.Examples.QuadTreeCameraMovement)); quadTreeCameraMovement.enabled = false; } if (menuObject != null) { menuHandler = (MenuScript)menuObject.gameObject.GetComponent(typeof(MenuScript)); } if (wwwHandler != null) { wwwScript = (WWWHandler)wwwHandler.gameObject.GetComponent(typeof(WWWHandler)); } else { wwwHandler = GameObject.FindGameObjectWithTag("WWWObject"); wwwScript = (WWWHandler)wwwHandler.GetComponent <WWWHandler>(); } if (annotationObject != null) { annotationHandler = (AnnotationHandler)annotationObject.gameObject.GetComponent(typeof(AnnotationHandler)); } if (annotationObject != null) { annotationHandler = (AnnotationHandler)annotationObject.gameObject.GetComponent(typeof(AnnotationHandler)); } if (sceneObject != null) { sceneManager = (SceneManager)sceneObject.gameObject.GetComponent(typeof(SceneManager)); } if (directionsObjects != null) { directionsHandler = (DirectionsHandler)directionsObjects.gameObject.GetComponent(typeof(DirectionsHandler)); } if (searchDirectionsObject != null) { searchDirectionsHandler = (DirectionsHandler)searchDirectionsObject.gameObject.GetComponent(typeof(DirectionsHandler)); } isHiking = false; StartCoroutine(initUser()); createAnnotationButton.onClick.AddListener(onClickAnnotation); submitAnnotationButton.onClick.AddListener(onAnnotationSubmit); exitSelectionButton.onClick.AddListener(disable2D); hikeButton.onClick.AddListener(onHike); mapButton.onClick.AddListener(() => enable2D(true)); exploreButton.onClick.AddListener(enableExplore); placesButton.onClick.AddListener(enablePlaces); settingsButton.onClick.AddListener(enableSettings); toggleARButton.onClick.AddListener(disable2D); exitHikeButton.onClick.AddListener(exitHike); recenterButton.onClick.AddListener(recenter); inAR = true; usernameText.text = GlobalUserManager.Instance.username; }