I suppose you want to compare if the rotations match, if so you can do it by using Quaternion.Angle with rotation A and rotation B as arguments and then make an if-block to check if the angle is less than a specific threshold.