Mobile bloom shder material setting help

Hi,

I’m using the mobile bloom effect found HERE

I’m adding it to my main camera using

gameObject.AddComponent("MobileBloom");

But this is not setting the Bloom material in the editor and I get the error

UnassignedReferenceException: The variable bloomMaterial of 'MobileBloom' has not been assigned.

Because my game adds the mobile bloom shader at runtime it doent set the bloom material.

How would I modify the code to set the bloom material at runtime??

Thanks in advance!

function Awake(){
gameObject.AddComponent(MobileBloom);
}

Have you try this?