Dissable lights per camera?

I did have this working before i updated to the latest unity version with this script:

public List<Light> Lights;

void OnPreRender(){
	foreach (Light light in Lights){
		light.enabled = false;
	}
}
 
void OnPostRender(){
	foreach (Light light in Lights){
		light.enabled = true;
	}
}

Is there any other way to disable lights per camera when both cameras are rendering at the same time.

Nevermind, This has been fixed using “OnPreCull()” instead of OnPreRender.

ooh, would anyone like to explain this to me? I currently have a problem where I’m having flares render twice in a scene and I don’t know how to disable individual lights per camera (I need some flares to render on one camera and a different set to render on the second).