Example #1
0
    /// <summary>
    /// sets the movement of the car and calls methods depending on which way the car is
    /// </summary>
    private void Move()
    {
        distanceTravelled += moveSpeed * Time.deltaTime / OneHundredPercents;
        transform.position = CurrentPath.GetPoint(distanceTravelled);
        transform.LookAt(transform.position + CurrentPath.GetDirection(distanceTravelled));

        if (CurrentPath.GetType().Equals(typeof(PolicePath)))
        {
            ActionsOnPolicePath(CurrentPath as PolicePath);
        }
        else
        {
            ActionsOnCommonPath();
        }
    }