Make objects not interactable
Сan I somehow make objects that belong to specified layer not interactable, so player can't click them? Or maybe there's some other way to do this? I tried setting timescale to 0, but that affects only physics updates and clicks on objects are still catched
if these objects are UI components you can set interactable to false,
if these objects are 3D or 2D meshes with colliders you can disable colliders.
Thanks, but can I somehow do that for bunch of objects? So probably there is feature at least for 2D and 3D objects - make all their colliders turned off?
Try the response from here : http://answers.unity3d.com/questions/827821/unity-46-ui-ignore-raycast.html . $$anonymous$$ake an component that implements ICanvasRaycastFilter , and regulate the mode/behaviour externally.
But my clicks are handled not by raycasts but by $$anonymous$$onoBehaviour's method "On$$anonymous$$ouseDown()", is there a way to solve this problem without changing "On$$anonymous$$ouseDown()" to raycasts?
You could add a CanvasGroup component to the elements you want to be flexible. Also you can manage their behaviour via scripts to match your requirements.
You can perhaps change the layer of the objects dynamically . From what i can see in the documentation, On$$anonymous$$ouseDown ignores the objects in the IngoreRaycast Layer. Perhaps you can use this to your advantage.