/// <summary> /// Add control points to the manager for debugging. /// </summary> void SetupDebugObjects() { for (var i = 0; i < locationPath.locations.Length; i++) { var go = GameObject.CreatePrimitive(PrimitiveType.Sphere); go.GetComponent <MeshRenderer>().material.color = Color.blue; go.name = "Path Point " + i; manager.Add(new ARLocationManagerEntry { instance = go, location = locationPath.locations[i], options = new ARLocationObjectOptions { isHeightRelative = heightRelativeToDevice, showDebugInfoPanel = true, createInstance = false, movementSmoothingFactor = 0 } }); } var prefab = arLocationDebugInfo.debugInfoPrefab; var canvas = arLocationDebugInfo.canvas; debugInfoPanel = Instantiate(prefab, canvas.transform); }
private void Start() { manager = ARLocationManager.Instance; points = new Vector3[path.locations.Length]; for (var i = 0; i < points.Length; i++) { points[i] = path.locations[i].ToVector3(); } spline = Utils.BuildSpline(path.splineType, points, splineSampleSize, path.alpha); var sample = spline.SamplePoints(objectCount); entries = new ARLocationManagerEntry[sample.Length]; for (var i = 0; i < entries.Length; i++) { entries[i] = new ARLocationManagerEntry { instance = prefab, location = new Location(sample[i].z, sample[i].x, sample[i].y), options = new ARLocationObjectOptions { isHeightRelative = isHeightRelative, movementSmoothingFactor = movementSmoothingFactor, showDebugInfoPanel = showDebugInfoPanel, createInstance = true } }; manager.Add(entries[i]); } }
public void AddLocation(Location location) { GameObject Prefab = thePrefab; Prefab.GetComponentInChildren <Text>().text = location.label; Prefab.transform.GetChild(0).GetChild(0).Find("goodText").GetComponent <Text>().text = Convert.ToString(location.likecnt); if (isClickChecked(location) == true) { Prefab.transform.GetChild(0).GetChild(0).Find("heart").GetComponent <Text>().text = "<color=#ff0000>" + "♥" + "</color>"; //하트 빨강으로 변경 } //Prefab.transform.GetChild(0).Find("goodText").GetComponent<Text>().text = Convert.ToString(location.isClickUID.Count); manager.Add(new ARLocationManagerEntry { instance = Prefab, location = location, options = new ARLocationObjectOptions { isHeightRelative = isHeightRelative, showDebugInfoPanel = showDebugInfoPanel, movementSmoothingFactor = movementSmoothingFactor, createInstance = true, } }); }
// Use this for initialization void Start() { Location currentLoc = new Location(); currentLoc.longitude = Convert.ToDouble(Input.location.lastData.longitude); currentLoc.latitude = Convert.ToDouble(Input.location.lastData.latitude); currentLoc.altitude = 0; manager = ARLocationManager.Instance; entry = new ARLocationManagerEntry { instance = gameObject, location = currentLoc, options = new ARLocationObjectOptions { isHeightRelative = isHeightRelative, showDebugInfoPanel = showDebugInfoPanel, movementSmoothingFactor = movementSmoothingFactor, createInstance = false } }; manager.Add(entry); }
/// <summary> /// Add control points to the manager for debugging. /// </summary> void SetupDebugObjects() { string RecLocation = PlayerPrefs.GetString("LocationPath"); string word = "|"; string[] words = RecLocation.Split(new string[] { word }, StringSplitOptions.None); int cnt = words.Length; string[] val = RecLocation.Split('|'); for (var i = 0; i < cnt; i++) { Location location1 = new Location(); if (i == 0) { location1.longitude = locationProvider.currentLocation.longitude; location1.latitude = locationProvider.currentLocation.latitude; location1.altitude = -1.5; } else if (i == cnt - 1) { string[] val2 = val[i - 1].Split(','); location1.longitude = Convert.ToDouble(val2[0]); location1.latitude = Convert.ToDouble(val2[1]); location1.altitude = -1.5; } else { string[] val2 = val[i - 1].Split(','); location1.longitude = Convert.ToDouble(val2[0]); location1.latitude = Convert.ToDouble(val2[1]); location1.altitude = -1.5; } var go = GameObject.CreatePrimitive(PrimitiveType.Sphere); go.GetComponent <MeshRenderer>().material.color = Color.blue; go.name = "Path Point " + i; manager.Add(new ARLocationManagerEntry { instance = go, location = location1, options = new ARLocationObjectOptions { isHeightRelative = heightRelativeToDevice, showDebugInfoPanel = true, createInstance = false, movementSmoothingFactor = 0 } }); } }
/// <summary> /// Adds a location to the locations list. /// </summary> /// <param name="location"></param> public void AddLocation(Location location) { manager.Add(new ARLocationManagerEntry { instance = prefab, location = location, options = new ARLocationObjectOptions { isHeightRelative = isHeightRelative, showDebugInfoPanel = showDebugInfoPanel, movementSmoothingFactor = movementSmoothingFactor, createInstance = true, } }); }
/// <summary> /// Adds a location to the locations list. /// </summary> /// <param name="location"></param> public void AddLocation(Location location) { GameObject thePrefab = prefab; TextMesh textMesh = prefab.GetComponentInChildren <TextMesh>(); textMesh.text = location.label; manager.Add(new ARLocationManagerEntry { instance = thePrefab, location = location, options = new ARLocationObjectOptions { isHeightRelative = isHeightRelative, showDebugInfoPanel = showDebugInfoPanel, movementSmoothingFactor = movementSmoothingFactor, createInstance = true, } }); }
void AddPOI(Location location, string name) { var textInstance = Instantiate(textPrefab.gameObject); textInstance.GetComponent <TextMesh>().text = name; entries.Add(new ARLocationManagerEntry { instance = textInstance, location = location, options = new ARLocationObjectOptions { isHeightRelative = true, showDebugInfoPanel = true, createInstance = false, movementSmoothingFactor = movementSmoothingFactor } }); manager.Add(entries[entries.Count - 1]); }