Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Companella on July 02, 2013, 10:45:32 PM

Title: about mouse(touch) events
Post by: Companella on July 02, 2013, 10:45:32 PM
dear any~

If my ngui button received a mousedown or touchdown event, also my game world can be receive the event too, but i won't.
so, how to do to that my game world can't receive this mousedown event ?

Please!
Title: Re: about mouse(touch) events
Post by: Companella on July 03, 2013, 05:35:14 AM
Please,Please~
Title: Re: about mouse(touch) events
Post by: ArenMook on July 03, 2013, 05:48:55 AM
You need to use NGUI events in both places. You can't use OnMouse* series of events, nor Input.GetXXX.
Title: Re: about mouse(touch) events
Post by: Companella on July 03, 2013, 06:07:08 AM
Thank you very much!
so, i need add a UICamera component to my game world camera?
Title: Re: about mouse(touch) events
Post by: ArenMook on July 03, 2013, 06:07:46 AM
Yes.
Title: Re: about mouse(touch) events
Post by: SamK on November 12, 2014, 12:56:14 AM
Isnt there any NGUI listener or bool member.  That way we can just check that if any action on any NGUI UI item is performed.

Im facing the same problem. Im making an isometric game. When i press a button on HUD and drag(even within the bounds of that button) or any BG/button on a UI and drag the ray goes through and ISO functionalites are performed like drag or click.

Isnt there any Trigger/listener/dataMember liken when i press a button and drag the mouse/finger out the state remains pressed.
and Dragging is another case but simple click also goes through.

here is a code snippet of what im doing. If goes into this first code block but it also goes forward meaning skips this.

  1. if(iPhoneInput.touchCount > 0)
  2.         {
  3.             iPhoneTouch touch = iPhoneInput.touches[0];
  4.             ray = gState.world.nGUICamera.ScreenPointToRay(touch.position);                
  5.             if (Physics.Raycast(ray, out hit, Mathf.Infinity, LayerMask.NameToLayer("UI")) && (
  6.                 touch.phase == iPhoneTouchPhase.Ended || touch.phase == iPhoneTouchPhase.Canceled
  7.                 || touch.phase == iPhoneTouchPhase.Began))
  8.             {
  9.                 Debug.Log("IN CANCLE MODE");
  10.                 CancelTouchMode();
  11.                 return;
  12.             }
  13.         }
  14.  
  15.  
  16. and down some where in update i  do
  17. if(iPhoneInput.touchCount==1 )
  18.       {        
  19.          SingleTouchAction();
  20.       }


HOw to block this touch.
Title: Re: about mouse(touch) events
Post by: ArenMook on November 12, 2014, 07:44:06 AM
UICamera.isOverUI