How to make a user layer ignore raycasts of OnMouse* events?

Due to some reasons, I don’t want to put the gameobjects of that custom layer in IgnoreRaycast layer. So is there a way in unity configurations to add another layer to the list of layers ignoring raycast?

Check this out for more detail, Alucardj covered it well : Making raycast ignore multiple layers - Questions & Answers - Unity Discussions

but this may be what you’re looking for:

quoting from the topic:

Alucardj -"Now save this script, go back to Unity and attach the script to an empty gameObject or the camera (it doesn’t matter, this is just a test). Now look in the inspector, click on the drop-down menu then tick the layers you wish to be acknowledged. This is much easier than trying to implement the bitshift method in the documentation. Now you’ve seen how it works, simply use : "

 var myLayerMask : LayerMask;

 // function
 if ( Physics.Raycast(transform.position, transform.forward, Hit, Range, myLayerMask) )
     // Do Stuff

this would just be attached to the objects that you want to be ignored, add it to the Variable.

As far as settings in unity, you can try working with the Physics2d and Physics in Edit > Projects settings.
in order for it to work you may have to do a little more looking online.

hope this helped, and sorry if it didn’t.