I'd do the following:
- Create an empty GameObject called "RotorY" which will be responsible for y rotation of your camera (looking around).
- Create an empty GameObject "RotorX" as a child of "RotorY". This one will control x rotation (looking up and down)
- Make camera a child of RotorX. (also make sure RotorX and Camera have (0,0,0) position in local space)
- Add this script to any gameObject and assign rotorY and rotorX to the slots (while experimenting I ended up writing this script, lol)
EDIT January, 2017: added 2 lines in the code to make it work with unity 5.5