예제 #1
0
    protected void ReduceExternalForce()
    {
        if (Mathf.Approximately(_externalForce.x, 0f) && Mathf.Approximately(_externalForce.z, 0f))
        {
            _currentDrag = GetDrag(0f, _externalForce.y);
            _hasControl  = true;
            return;
        }
        float   vertical             = _externalForce.y;
        Vector3 lateralExternalForce = _externalForce;

        lateralExternalForce.y = 0f;
        _externalForce         = ExtraMath.ReduceVector(lateralExternalForce, Time.deltaTime * _currentDrag);
        _externalForce.y       = vertical;
    }