Esempio n. 1
0
    public void SteerWalkingDirection()
    {
        if (_lastTarget != _navAgent.steeringTarget)
        {
            _lastTarget = _navAgent.steeringTarget;

            if (_lerpRotComplete == true)
            {
                StartCoroutine(_lerpRotation);
            }
        }
        if (_lerpRotComplete == false && _lastTarget != Vector3.zero)
        {
            transform.rotation = WorldUtils.SmoothLook(
                transform.rotation,
                WorldUtils.GetDirection(transform.position, _lastTarget),
                _walkTurnSpeed);
        }
    }