Editor Script messing with Prefabs

I’ve extended the Inspector window with an editor script (C#) to do something automatically to a meshfilter when I click on it. The trouble is it also does this when I click on a Prefab in the Project view that ISN’T currently in the scene, thus changing my Prefab. I could map this function to a button in the Inspector, but I want it to happen automatically when I drag a Prefab into the scene.

Is there a way for my Editor script to tell the difference between an instance of a prefab in the scene, and the prefab itself in the Project view?

Thanks
Chris

Try

EditorUtility.IsPersistent(obj)

Slammin’!
Works like a charm, thanks!