Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.transform.CompareTag("Road"))
        {
            _pathController       = other.transform.parent.GetComponentInChildren <PathController>();
            _currentPathToFollow  = GetRandomPath(transform.position);
            _pathTimeGoesFrom0To1 = PathGoesFrom0To1(_currentPathToFollow);
            _distanceTravelledOnCurrentPathIsSet = false;
            _rotationIsBasedOnRotationPoint      = false;

            CurrentTile = other.GetComponentInParent <Tile>();
            if (CurrentTile.Type == Tile.TileType.Intersection || CurrentTile.Type == Tile.TileType.T_Junction)
            {
                _carBehaviour.AllowPriorityAwareness(true);
            }
            else
            {
                _carBehaviour.AllowPriorityAwareness(false);
            }

            //Debug.Log("ENTER:" + _currentPathToFollow.transform.root.name);
        }
    }