c# - Disabling mouse Input to a GameObject -


is there way in unity disable mouse inputs gameobject without removing/disabling collision box?

i want write script ignore mouse input of object after pressed once. it's not hard within scope of script, want other scripts on objects ignore mouse input without modifying other scripts.

according onmousedown documentation

this function not called on objects belong ignore raycast layer.

so, 1 way of doing switching layer of object ignore raycast.

this.gameobject.layer = layermask.nametolayer("ignore raycast"); 

but if have other functionality depends on raycasting, disabled (unless raycasting in other layers).


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -