How to control multiple materials from code??

How to control multiple materials from code??
i only get to control the main material but not the others… help!!!

Pm me your skype (: