public void OnDrop(PointerEventData eventData) { TiteresDragger target = TiteresDragger.itemBeingDragged; if (target != null) { SoundController.GetController().PlayDropSound(); target.DroppedInLandscape(); view.CheckOk(); } }
public void OnBeginDrag(PointerEventData eventData) { if (active) { transform.SetAsLastSibling(); SoundController.GetController().SetConcatenatingAudios(false); view.soundBtn.interactable = true; SoundController.GetController().PlayDragSound(); itemBeingDragged = this; startPosition = transform.position; GetComponent <CanvasGroup> ().blocksRaycasts = false; droppedInLandscape = false; } }
public void OnEndDrag(PointerEventData eventData = null) { if (active) { SoundController.GetController().SetConcatenatingAudios(false); view.soundBtn.interactable = true; SoundController.GetController().PlayDropSound(); itemBeingDragged = null; GetComponent <CanvasGroup> ().blocksRaycasts = true; if (!droppedInLandscape) { transform.position = startPosition; } } }