A multifunctional system in which a nanostructure (size range of about 10-1000 nm) degrades on exposure to an infection and its associated inflammatory milieu. The degraded nanostructures release the encapsulated drug during the process of degradation, where the kinetics of drug release is determined by the severity of the infection and inflammation. This degradation is triggered by proteases secreted by the pathogen, host polymorphonuclear leucocytes and other host cells. The nanostructures are conjugated to anti-TLR (Toll-like receptor) ligands for targeting the corneal epithelium and blocking the inflammatory pathway.