public unsafe void OnEndDrag(PointerEventData eventData)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			if (!dragging)
			{
				return;
			}
			m_lastEvent = eventData;
			bool flag = false;
			bool flag2 = true;
			bool flag3 = true;
			bool flag4 = true;
			int i = 0;
			for (int count = m_candidates.Count; i < count; i++)
			{
				DragNDropClient dragNDropClient = m_candidates[i];
				if (dragNDropClient.activeInHierarchy && RectTransformUtility.RectangleContainsScreenPoint(dragNDropClient.rectTransform, eventData.get_position(), eventData.get_pressEventCamera()))
				{
					flag2 = dragNDropClient.OnDrop(m_copy, eventData);
					flag = true;
					break;
				}
			}
			if (!flag)
			{
				flag2 = m_sourceClient.OnDropOut(m_copy, eventData);
				flag3 = !flag2;
			}
			else
			{
				this.OnDragEndSuccessful?.Invoke();
			}
			if (flag2)
			{
				if (flag3)
				{
					Object.Destroy(m_copy.get_gameObject());
				}
				else
				{
					m_tweenDestroy = m_copy.DestroySequence();
					if (m_tweenDestroy == null)
					{
						Object.Destroy(m_copy.get_gameObject());
					}
					else
					{
						TweenSettingsExtensions.OnKill<Tween>(m_tweenDestroy, new TweenCallback((object)this, (IntPtr)(void*)/*OpCode not supported: LdFtn*/));
						flag4 = false;
					}
				}
			}
			if (flag4)
			{
				EndDragAction();
			}
		}
Пример #2
0
 protected virtual void CheckInit()
 {
     if (m_initialized)
     {
         return;
     }
     m_rectTransform = this.GetComponent <RectTransform>();
     m_cellRenderer  = m_prefab.GetComponent <CellRenderer>();
     if (m_cellRenderer == null)
     {
         Debug.LogWarningFormat("No valid CellRenderer found in the prefab {0} for list {1}", new object[2]
         {
             m_prefab.get_name(),
             this.get_name()
         });
         return;
     }
     m_itemType = m_cellRenderer.GetValueType();
     for (int num = m_content.get_transform().get_childCount() - 1; num >= 0; num--)
     {
         CellRenderer component = m_content.get_transform().GetChild(num).GetComponent <CellRenderer>();
         if (Object.op_Implicit(component))
         {
             Object.Destroy(component.get_gameObject());
         }
     }
     m_cellRendererInstance = InitializeRenderer();
     m_initialized          = true;
 }
Пример #3
0
 protected void ReturnToPool(CellRenderer cellRenderer)
 {
     if (!(cellRenderer == null))
     {
         m_elementPool.Add(cellRenderer);
         cellRenderer.get_gameObject().SetActive(false);
     }
 }
Пример #4
0
 public bool OnDrop(CellRenderer cellRenderer, PointerEventData evt)
 {
     if (!m_enableDragAndDrop)
     {
         return(true);
     }
     if (m_dragNDropValidator != null && !m_dragNDropValidator.IsValidDrop(m_value))
     {
         return(true);
     }
     if (m_insertOnDrop)
     {
         if (Object.op_Implicit(m_cellRendererInstance.get_gameObject()))
         {
             Object.Destroy(m_cellRendererInstance.get_gameObject());
         }
         m_cellRendererInstance = cellRenderer;
         ConfigureCellRenderer(cellRenderer, instant: false, andUpdate: true);
         SetValue(cellRenderer.value);
         return(false);
     }
     return(true);
 }
Пример #5
0
        protected CellRenderer GetFromPool()
        {
            //IL_002e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0033: Unknown result type (might be due to invalid IL or missing references)
            if (m_elementPool.Count == 0)
            {
                CellRenderer  cellRenderer = Object.Instantiate <CellRenderer>(m_cellRenderer);
                RectTransform component    = cellRenderer.GetComponent <RectTransform>();
                component.SetParent(this.get_transform(), false);
                component.set_sizeDelta(Vector2Int.op_Implicit(m_cellSize));
                SetCellRectTransformAnchors(component);
                cellRenderer.dragNDropClient = this;
                return(cellRenderer);
            }
            CellRenderer cellRenderer2 = m_elementPool[m_elementPool.Count - 1];

            m_elementPool.RemoveAt(m_elementPool.Count - 1);
            cellRenderer2.get_gameObject().SetActive(true);
            return(cellRenderer2);
        }