1
NGUI 3 Support / Re: Prevent Click Through
« on: March 16, 2018, 03:07:43 AM »
Ello everyone,
I had the same issue. Im using 2Dtoolkit camera for game scene and UIRoot camera for UI. Tired BIS's solution but didnt work for some reasons.
But there's this UICamera.hoveredObject in his code and led me to this solution.
UICamera.interactingWithUI checks if user is interacting with UI, so I put this in LateUpdate like so.
void LateUpdate()
{
if(!UICamera.interactingWithUI){
HandleTouch();
HandleMouse();
resetCamera();
}
}
Hope it helps.
I had the same issue. Im using 2Dtoolkit camera for game scene and UIRoot camera for UI. Tired BIS's solution but didnt work for some reasons.
But there's this UICamera.hoveredObject in his code and led me to this solution.
UICamera.interactingWithUI checks if user is interacting with UI, so I put this in LateUpdate like so.
void LateUpdate()
{
if(!UICamera.interactingWithUI){
HandleTouch();
HandleMouse();
resetCamera();
}
}
Hope it helps.