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); } }
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"); }
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(); } } }
public void OnPointerClick(PointerEventData eventData) { if (eventData.dragging) { return; } if (eventData.button == PointerEventData.InputButton.Right) { HeroRoster.RecruitSlotClicked(this); } }
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 }