public bool IsDraggingTab(PTTouch touch) { return(this != null && touch != null && ( imageStretch && touch.hitsBegin.ContainsKey(imageStretch.GetComponent <Collider>()) || imageSwapping && touch.hitsBegin.ContainsKey(imageSwapping.GetComponent <Collider>()) )); }
private void HandlerOnDragBegin(PTTouch touch) { PTSeat lastSeat = seat; transform.SetParent(null); if (lastSeat) { lastSeat.UpdateLabel(); } }
public void SelecetSection(PTTouch touch) { if (sections.GetComponent <Image>().fillAmount < 1) { return; } Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position); Vector2 screenPosition_BorderInside = Camera.main.WorldToScreenPoint(radialBorderInside.position); Vector2 screenPosition_BorderOutside = Camera.main.WorldToScreenPoint(radialBorderOutside.position); Vector2 diffTouch = new Vector2(touch.position.x, touch.position.y) - screenPosition; Vector2 diffMin = screenPosition_BorderInside - screenPosition; Vector2 diffMax = screenPosition_BorderOutside - screenPosition; RadialSection section = RadialSection.unknown; float angle = PTUtility.Angle(screenPosition, touch.position) + 45; angle = angle > 360 ? angle - 360 : angle; int direction = (int)(angle / 90); if (diffTouch.sqrMagnitude < diffMin.sqrMagnitude) { section = RadialSection.inside; } else if (diffTouch.sqrMagnitude > diffMax.sqrMagnitude) { section = RadialSection.outside; } else { section = (RadialSection)direction; } sections.Input(section); }