Example #1
0
 public bool IsTouchReferenceEqualsCurrentTouch(KiltUICamera.MouseOrTouch p_currentTouch)
 {
     if (p_currentTouch != null && _touchReference != null &&
         (
             (p_currentTouch == _touchReference) ||
             (p_currentTouch.current == _touchReference.current) ||
             (p_currentTouch.pressed == _touchReference.pressed) ||
             (p_currentTouch.dragged == _touchReference.dragged)
         )
         )
     {
         return(true);
     }
     return(false);
 }
Example #2
0
 protected virtual void ResetToNonPressingState(bool p_forceDeativateColliders = false)
 {
     if (CameraThatDrawThisObject != null && TrailComponent != null)
     {
         _grabbing                      = false;
         _touchReference                = null;
         Cutting                        = false;
         TrailComponent.lifeTime        = 0;
         TrailComponent.ignoreTimeScale = IgnoreTimeScale;
         _currentDeltaTime              = _maxDeltaTime;
         _oldPosition                   = this.transform.position;
         if (p_forceDeativateColliders && gameObject.GetComponent <Collider2D>() != null)
         {
             gameObject.GetComponent <Collider2D>().enabled = Cutting;
         }
     }
 }
Example #3
0
 //Only works when grabing touch inside HandleGlobalPress
 protected virtual void GrabTouch()
 {
     if (!_grabbing && KiltUICamera.currentTouch != null)
     {
         if (!OnlyShowWhenGrabTouch || KiltUICamera.currentTouch.current == null)
         {
             if (!OnlyShowWhenGrabTouch && !FocusContainer.IsUnderFocus(this.gameObject))
             {
                 return;
             }
             _grabbing       = true;
             _touchReference = KiltUICamera.currentTouch;
             if (KiltUICamera.currentTouch.current == null)
             {
                 KiltUICamera.currentTouch.current = this.gameObject;
                 KiltUICamera.currentTouch.pressed = this.gameObject;
                 KiltUICamera.currentTouch.dragged = this.gameObject;
             }
             UpdateTrail(true);
         }
     }
 }
	protected virtual void ResetToNonPressingState(bool p_forceDeativateColliders = false)
	{
		if(CameraThatDrawThisObject != null && TrailComponent != null)
		{
			_grabbing = false;
			_touchReference = null;
			Cutting = false;
			TrailComponent.lifeTime = 0;
			TrailComponent.ignoreTimeScale = IgnoreTimeScale;
			_currentDeltaTime = _maxDeltaTime;
			_oldPosition = this.transform.position;
			if(p_forceDeativateColliders && gameObject.GetComponent<Collider2D>() != null) 
				gameObject.GetComponent<Collider2D>().enabled = Cutting;
		}
	}
	//Only works when grabing touch inside HandleGlobalPress
	protected virtual void GrabTouch()
	{
		if(!_grabbing && KiltUICamera.currentTouch != null)
		{
			if(!OnlyShowWhenGrabTouch || KiltUICamera.currentTouch.current == null)
			{
				if(!OnlyShowWhenGrabTouch && !FocusContainer.IsUnderFocus(this.gameObject))
					return;
				_grabbing = true;
				_touchReference = KiltUICamera.currentTouch;
				if(KiltUICamera.currentTouch.current == null)
				{
					KiltUICamera.currentTouch.current = this.gameObject;
					KiltUICamera.currentTouch.pressed = this.gameObject;
					KiltUICamera.currentTouch.dragged = this.gameObject;
				}
				UpdateTrail(true);
			}
		}
	}