private void Start() { BuildingLoader.Instance = this; this.setupMap(); this.pointCloudsToDisplay = new Queue <PointCloud>(); this.buildings = new BuildingHashSet(); this.activeBuildings = new Dictionary <string, PointCloudBehaviour>(); var thread = new System.Threading.Thread(this.loadMetadata); thread.Start(); GameObject selectionGO = GameObject.Find("Selection"); this.selectionRenderer = selectionGO.GetComponent <LineRenderer>(); this.selectionMarker = selectionGO.AddComponent <LocationMarkerBehaviour>(); this.selectionMarker.Map = this.map; }
/// <summary> /// Sets the marker for the host's location and orientation using two GameObject instances for display. /// </summary> /// <returns>The location marker.</returns> /// <param name="locationGo">The location GameObject instance.</param> /// <param name="orientationGo">The orientation GameObject instance.</param> /// <typeparam name="T">The 1st type parameter.</typeparam> public T SetLocationMarker <T> (GameObject locationGo, GameObject orientationGo) where T : LocationMarkerBehaviour { // create a GameObject and add the templated Marker component to it GameObject markerObject = new GameObject("[location marker]"); markerObject.transform.parent = this.gameObject.transform; T marker = markerObject.AddComponent <T> (); locationGo.transform.parent = markerObject.transform; locationGo.transform.localPosition = Vector3.zero; if (orientationGo != null) { marker.OrientationMarker = orientationGo.transform; } // setup the marker marker.Map = this; if (usesLocation && UnityEngine.Input.location.status == LocationServiceStatus.Running) { marker.CoordinatesWGS84 = new double[2] { UnityEngine.Input.location.lastData.longitude, UnityEngine.Input.location.lastData.latitude } } ; else #if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9 { markerObject.SetActiveRecursively(false); } #else { markerObject.SetActive(false); } #endif // set the location marker locationMarker = marker; // tell the map to update IsDirty = true; return(marker); }