Exemple #1
0
    public void OnBeginDrag(PointerEventData eventData)
    {
        if (eventData.button != PointerEventData.InputButton.Left || Hero == null)
        {
            eventData.dragging    = false;
            eventData.pointerDrag = null;
            return;
        }

        if (Hero.Status == HeroStatus.Tavern || Hero.Status == HeroStatus.Sanitarium ||
            Hero.Status == HeroStatus.Abbey || Hero.Status == HeroStatus.Missing)
        {
            eventData.dragging    = false;
            eventData.pointerDrag = null;
            return;
        }

        HeroRoster.Dragging = true;
        HeroRoster.RosterLive.gameObject.SetActive(true);
        HeroRoster.HeroSlotBeginDragging(this);
        DragManager.Instanse.StartDragging(this, eventData);

        if (HeroRoster.Hovered)
        {
            SlotController.SetTrigger("hide");
            HeroRoster.PlaceHolder.RectTransform.SetSiblingIndex(RectTransform.GetSiblingIndex());
            HeroRoster.PlaceHolder.SlotController.SetTrigger("show");
            HeroRoster.PlaceHolder.SlotController.SetBool("isHidden", false);
        }
    }
Exemple #2
0
    public void OnEndDrag(PointerEventData eventData)
    {
        HeroRoster.Dragging = false;
        HeroRoster.RosterLive.gameObject.SetActive(false);
        HeroRoster.HeroSlotEndDragging(this);
        DragManager.Instanse.EndDragging(this, eventData);

        HeroRoster.PlaceHolder.SlotController.SetBool("isHidden", true);
        HeroRoster.PlaceHolder.SlotController.SetTrigger("hide");
        SlotController.SetTrigger("show");
    }
Exemple #3
0
 public void OnDrop(PointerEventData eventData)
 {
     if (eventData.pointerDrag.CompareTag("Recruit"))
     {
         var recruitSlot = eventData.pointerDrag.GetComponent <RecruitSlot>();
         if (HeroRoster.CreateSlot(recruitSlot, this) != null)
         {
             recruitSlot.OnEndDrag(eventData);
             recruitSlot.RemoveSlot();
         }
     }
 }
Exemple #4
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.dragging)
        {
            return;
        }

        if (eventData.button == PointerEventData.InputButton.Right)
        {
            HeroRoster.RecruitSlotClicked(this);
        }
    }
Exemple #5
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.dragging)
        {
            return;
        }

#if UNITY_ANDROID || UNITY_IOS
        if (doubleTapTimer > 0)
        {
            HeroRoster.HeroSlotClicked(this);
        }
        else
        {
            doubleTapTimer = doubleTapTime;
        }
#else
        if (eventData.button == PointerEventData.InputButton.Right)
        {
            HeroRoster.HeroSlotClicked(this);
        }
#endif
    }