/** * Sets the destination of the NavMesh agent and updates the local variable _destination that * stores more information than the position */ public void UpdateDestination(Room destination) { this.destination = destination; destinationFloor = destination.Floor; // Setting the destination height to the ground level var floorTransform = _ModelDatabase.GetFloorTransform(destination.Floor); if (floorTransform == null) { Debug.Log("NO FLOOR FOUND AT ROOM: " + destination.Name); } destinationPos = new Vector3(destination.Location.position.x, floorTransform.position.y, destination.Location.position.z); _NavMeshAgent.SetDestination(destinationPos); SetDestinationInfos(); navigationInformation.SetDestinationName(destination.Name); }
/** * Sets the destination of the NavMesh agent and updates the local variable _destination that * stores more information than the position */ public void UpdateDestination(Room destination) { this.destination = destination; destinationFloor = destination.Floor; // Setting the destination height to the ground level var floorTransform = _ModelDatabase.GetFloorTransform(destination.Floor); if (floorTransform == null) { Debug.Log("NO FLOOR FOUND AT ROOM: " + destination.Name); } destinationPos = new Vector3(destination.Location.position.x, floorTransform.position.y, destination.Location.position.z); _NavMeshAgent.SetDestination(destinationPos); var nextFloorPath = GetPathToNextFloor(); var totalDistance = GetPathDistance(GetTotalPath()); _NavigationPresenter.DisplayNavigationInformation(totalDistance, nextFloorPath); }