Environmentally Influenced Duplication Patterns Followed By Functional Shifts Fueling The Evolution Of Metazoan Sensory Systems