Esempio n. 1
0
    private void SetDestinationInfos()
    {
        var nextFloorPath = GetPathToNextFloor();

        navigationInformation.UpdateNavigationInformation(nextFloorPath, _NavMeshAgent.nextPosition, destinationPos, _ARCamera, !_NavMeshAgent.pathPending);
        _NavigationPresenter.DisplayNavigationInformation(navigationInformation);
    }
    /**
     *  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);
    }