Ejemplo n.º 1
0
    /////////////////////////////////////////////////////////////////////////////



    Vector3 CalculateInitialVelocityMovingTarget()
    {
        //find out where the target will be in our desired time
        //aim for that position
        Vector3 targetVelocity     = _movingTarget.GetVelocity();
        Vector3 targetDisplacement = targetVelocity * _desiredAirTime;
        Vector3 targetPosition     = _movingTarget.transform.position + targetDisplacement;

        return(CalculateInitialVelocity(targetPosition, true));
    }