Пример #1
0
    public void UpdateMovement()
    {
        if (Vector3.Distance(transform.position, targetTilePos) >= 0.05)
        {
            // The target tile has not yet been reached
            CalculateHeading(targetTilePos);
            SetHorizontalVelocity();
            if (AlwaysFaceForward)
            {
                transform.forward = heading;
            }
            transform.position += velocity * Time.deltaTime;
        }
        else
        {
            // The target tile has been reached
            transform.position = targetTilePos;

            currentTile.TileSteppedOn();

            m_BaseController.DoneWalking();
        }
    }