示例#1
0
    public void OnEndDrag(PointerEventData eventData)
    {
        dragItem = null;
        canvasGroup.blocksRaycasts = true;
        if (slot == null)
        {
            transform.SetParent(startParrent);
            transform.position = startPosition;
        }
        else
        {
            transform.SetParent(slot);
            transform.localPosition = Vector3.zero;

            countorOfOdersForGrouping = ordersForGrouping != null ? ordersForGrouping.Length : 0;
            foreach (var cell in ordersForGrouping)
            {
                if (cell.transform.childCount == 0)
                {
                    countorOfOdersForGrouping--;
                }
            }
            if (countorOfOdersForGrouping == 0)
            {
                ShowButtonGo?.Invoke(true);
            }
            else
            {
                ShowButtonGo?.Invoke(false);
            }
        }
        slot = null;
    }
示例#2
0
 private void Start()
 {
     countorOfOdersForGrouping = ordersForGrouping != null ? ordersForGrouping.Length : 0;
     ShowButtonGo?.Invoke(false);
     canvasGroup = GetComponent <CanvasGroup>();
     dragLayer   = GameObject.
                   FindGameObjectWithTag("DragLayer").
                   GetComponent <RectTransform>();
 }
示例#3
0
 public void OnBeginDrag(PointerEventData eventData)
 {
     ShowButtonGo?.Invoke(false);
     slot         = null;
     startParrent = transform.parent;
     transform.SetParent(dragLayer);
     dragItem      = this;
     startPosition = transform.position;
     canvasGroup.blocksRaycasts = false;
 }