private static void SetupGeographicsTransforms(WRLDARKitSetupHelper.CubeInfo[] cubes) { foreach (var cube in cubes) { GeographicTransform geographicTransform = cube.cubeGameObject.AddComponent <GeographicTransform> (); SerializedObject serializedObject = new UnityEditor.SerializedObject(geographicTransform); SerializedProperty latitudeProperty = serializedObject.FindProperty("InitialLatitude"); SerializedProperty longitudeProperty = serializedObject.FindProperty("InitialLongitude"); latitudeProperty.doubleValue = cube.latitudeDegrees; longitudeProperty.doubleValue = cube.longitudeDegrees; serializedObject.ApplyModifiedProperties(); } }
public void Spawn(Texture texture, double latitude, double longitude) { targetPosition = new LatLong(latitude, longitude); Api.Instance.CameraApi.MoveTo(targetPosition, distanceFromInterest: 1200, headingDegrees: 0, tiltDegrees: 45); sphereParent = new GameObject("sphereParent"); gt = sphereParent.AddComponent(typeof(GeographicTransform)) as GeographicTransform; gt.SetPosition(targetPosition); ReversedSphere = Instantiate(ReversedSphere, new Vector3(0, 60, 0), Quaternion.identity); ReversedSphere.transform.SetParent(sphereParent.transform); //var texture = Resources.Load<Texture2D>("Textures/01-7745"); SetTexture(texture); }
public void Spawn(double latitude, double longitude) { targetPosition = new LatLong(latitude, longitude); Api.Instance.CameraApi.MoveTo(targetPosition, distanceFromInterest: 1200, headingDegrees: 0, tiltDegrees: 45); BallonParent = new GameObject("BallonParent"); gt = BallonParent.AddComponent(typeof(GeographicTransform)) as GeographicTransform; gt.SetPosition(targetPosition); Ballon = Instantiate(Ballon, new Vector3(0, 260, 0), Quaternion.identity); if (BallonParent != null) { Ballon.transform.SetParent(BallonParent.transform); } }
public void Spawn(double latitude, double longitude) { BallonParent = new GameObject("BallonParent"); targetPosition = new LatLong(latitude, longitude); gt = BallonParent.AddComponent(typeof(GeographicTransform)) as GeographicTransform; gt.SetPosition(targetPosition); var ballon = Instantiate(Ballon, new Vector3(0, 30, 0), Quaternion.identity); var button = Instantiate(Button, new Vector3(0, 80, 0), Quaternion.identity); if (BallonParent != null) { ballon.transform.SetParent(BallonParent.transform); button.transform.SetParent(BallonParent.transform); } }
private static void SetupGeographicsTransforms(WRLDARCoreSetupHelper wrldARCoreSetupHelper) { WRLDARCoreSetupHelper.CubeInfo[] cubes; foreach (WRLDARCoreSetupHelper.CubeInfo cubeInfo in wrldARCoreSetupHelper.cubeInfos) { // Please import WRLD3D plugin if you are seeing a compiler error here. GeographicTransform geographicTransform = cubeInfo.cubeGameObject.AddComponent <GeographicTransform> (); SerializedObject serializedObject = new UnityEditor.SerializedObject(geographicTransform); SerializedProperty latitudeProperty = serializedObject.FindProperty("InitialLatitude"); SerializedProperty longitudeProperty = serializedObject.FindProperty("InitialLongitude"); latitudeProperty.doubleValue = cubeInfo.latitudeDegrees; longitudeProperty.doubleValue = cubeInfo.longitudeDegrees; serializedObject.ApplyModifiedProperties(); } }
public void Initialzie(CityPopularityDBObject cityPopularity, Dictionary <string, TrackMetadataDBObject> trackMetadata) { latitude = cityPopularity.latitude; longitude = cityPopularity.longitude; coordinateFrame = GetComponentInChildren <GeographicTransform>(); geoPos = LatLong.FromDegrees(latitude, longitude); coordinateFrame.SetPosition(geoPos); trackPanels = new List <GameObject>(); canvas = GetComponentInChildren <Canvas>(); canvas.GetComponentInChildren <Text>().text = cityPopularity.cityName; if (!trackMetadata.ContainsKey(cityPopularity.trackList[0])) { return; } InitializeTrackPanelHeader(trackMetadata[cityPopularity.trackList[0]]); for (int i = 1; i < cityPopularity.trackList.Length; i++) { string trackAsin = cityPopularity.trackList[i]; if (!trackMetadata.ContainsKey(trackAsin)) { continue; } GameObject trackPanel = GameObject.Instantiate(trackPanelPrefab); trackPanel.transform.parent = canvas.transform; Vector3 pos = new Vector3(0.0f, initialYOffset + i * yOffsetPadding, 0.0f); trackPanel.transform.position = pos; InitializeTrackPanel(trackPanel, trackMetadata[trackAsin]); trackPanels.Add(trackPanel); } HideOrShowTrackPanels(); Api.Instance.GeographicApi.RegisterGeographicTransform(coordinateFrame); }
// Use this for initialization void Start() { player = GameObject.Find("Player").GetComponent <GeographicTransform>(); }