コード例 #1
0
    public void OnDrop(PointerEventData eventData)
    {
        TiteresDragger target = TiteresDragger.itemBeingDragged;

        if (target != null)
        {
            SoundController.GetController().PlayDropSound();
            target.DroppedInLandscape();
            view.CheckOk();
        }
    }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
    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;
            }
        }
    }