Home > other >  The unity of the mouse events
The unity of the mouse events

Time:09-24

In unity there is a 3 d scene and UI scene at the same time, the mouse to click when open the UI scene 3 d scenes are not subject to the mouse event, I want to do

CodePudding user response:

Say specific point

CodePudding user response:

How is the UI scene? UI should be canvas and so on, this kind of circumstance, you should go to see if ray emission place have a judgment, or look for on the UI is added starts

CodePudding user response:

I can think of method, there are two
First, the UI layer in the layer above the game scene, so click on the UI will not have influence upon the game scene;
Second, when the UI interface under the condition of existence, the game scene for mouse events get suspended, namely in front of the mouse events for the determination of whether a UI interface open

CodePudding user response:

The UI object Layer is set to "UI"
Using radiographic testing to do click
Physics. RayCast LayerMask parameter selection "UI"
  • Related