Added an onUpdate method to object.
Updated material generator script