private void NavigateToStart() { // Creates a new Bing Maps task. BingMapsTask task = new BingMapsTask(); task.Center = StartCoordinates.ToGeoCoordinate(); task.SearchTerm = String.Format("{0}", StartCoordinates.ToString(WF.Player.Core.GeoCoordinateUnit.DecimalDegrees)); task.ZoomLevel = 2; // Starts the task. task.Show(); }
public void StartGame() { RandomUtility.Initialize(Random.rotation); StartCoordinates startCoords = level.Generate(); PortalPosition = startCoords.playerPosition; player = Instantiate <Player> (_playerPrefab, PortalPosition, Quaternion.identity); Portal = Instantiate(_portalPrefab, PortalPosition, Quaternion.identity); rescuee = Instantiate(rescueePrefab, startCoords.rescueePosition, Quaternion.identity); enemyController.Initialize(startCoords.enemyPositions, player.transform); walkableMap = startCoords.walkableMap; Pathfinder.Create(walkableMap, (Vector2)level.grid.cellSize); _playerUI.gameObject.SetActive(true); _startMenu.SetActive(false); }
private void RefreshLocatedContent() { if (Cartridge == null) { return; } // Starting point. if (Cartridge.IsPlayAnywhere) { // Start pushpin -> hidden // Player marker -> visible // Map center -> player position // Sets the start location from device location, so that the map center reflects // the player position. if (Model.Core.DeviceLocation == null) { // No location yet: display a default. StartCoordinates = WF.Player.Core.ZonePoint.Zero; } else { // Change the current coordinates if it is far enough from the last one. if (StartCoordinates == null || Model.Core.DeviceLocation.GetDistanceTo(StartCoordinates.ToGeoCoordinate()) > 50) { StartCoordinates = Model.Core.DeviceLocation.ToZonePoint(); } } IsStartPushpinVisible = false; VectorToStartingCoordinate = null; } else { // Start pushpin -> visible // Player marker -> visible // Map center -> start location StartCoordinates = Cartridge.StartingLocation; IsStartPushpinVisible = true; VectorToStartingCoordinate = Model.Core.DeviceLocation == null ? null : Model.Core.DeviceLocation.ToZonePoint().GetVectorTo(StartCoordinates); } }