AFAIK very indirectly, in the sense that there are some actions/spells that reference targeting an enemy. I haven't found examples of targeting being separated from the action/spell itself though, so whether it's a phase of the attack/spell or something that happens before it open to debate, but...