Definitely unprofessional, and doubly so if one of the actors you’re directing is friends (or friends of friends) with the person you’re cheating on. That puts that person in a really, really difficult position. Do you tell your friend? What does that do for your workplace?