FairyGUI.TouchInfo.end C# (CSharp) Method

end() public method

public end ( ) : void
return void
		public void end()
		{
			began = false;

			if (target != null)
			{
				UpdateEvent();

				if (touchEndMonitors.Count > 0)
				{
					int len = touchEndMonitors.Count;
					for (int i = 0; i < len; i++)
						touchEndMonitors[i].GetChainBridges("onTouchEnd", sHelperChain, false);
					target.BubbleEvent("onTouchEnd", evt, sHelperChain);
					sHelperChain.Clear();
				}
				else
					target.onTouchEnd.BubbleCall(evt);
			}

			touchEndMonitors.Clear();

			if (Time.realtimeSinceStartup - lastClickTime < 0.35f)
			{
				if (clickCount == 2)
					clickCount = 1;
				else
					clickCount++;
			}
			else
				clickCount = 1;
			lastClickTime = Time.realtimeSinceStartup;
		}

Usage Example

示例#1
0
        void HandleMouseEvents()
        {
            TouchInfo touch = _touches[0];

            if (touch.x != _touchPosition.x || touch.y != _touchPosition.y)
            {
                touch.x = _touchPosition.x;
                touch.y = _touchPosition.y;
                touch.UpdateEvent();
                onTouchMove.Call(touch.evt);

                if (touch.lastRollOver != touch.target)
                {
                    HandleRollOver(touch);
                }
            }

            if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))
            {
                if (!touch.began)
                {
                    _touchCount = 1;
                    touch.begin();
                    touch.button = Input.GetMouseButtonDown(2) ? 2 : (Input.GetMouseButtonDown(1) ? 1 : 0);
                    this.focus   = touch.target;

                    if (touch.target != null)
                    {
                        touch.UpdateEvent();
                        touch.target.onTouchBegin.BubbleCall(touch.evt);
                    }
                }
            }
            if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2))
            {
                if (touch.began)
                {
                    _touchCount = 0;
                    touch.end();

                    DisplayObject clickTarget = touch.ClickTest();
                    if (clickTarget != null)
                    {
                        touch.UpdateEvent();

                        if (Input.GetMouseButtonUp(1))
                        {
                            clickTarget.onRightClick.BubbleCall(touch.evt);
                        }
                        else
                        {
                            clickTarget.onClick.BubbleCall(touch.evt);
                        }
                    }
                }
            }
        }
All Usage Examples Of FairyGUI.TouchInfo::end