Inheritance: UnityEngine.MonoBehaviour, IPointerUpHandler, IPointerDownHandler
 public override Ray Snap(Item item, PointerEventData data)
 {
     Ray ray = AttachPointRay();
     ray.origin = UpdateItem(item, data.pointerCurrentRaycast.worldPosition);
     ray.direction = -ray.direction;
     return ray;
 }
 public override void RemoveItem(Item item)
 {
     #if LOG
     Debug.Log("RemoveItem "+this.name);
     #endif
     SplineReplicator replicator = SplineReplicatorList.Find(r => r.Item == item);
     SplineReplicatorList.Remove(replicator);
     Destroy(replicator);
     SetStartEndPoint();
     SetColliderSize();
 }
 public void CallDelegateItemRaycast(Item item, System.Action<Item> action)
 {
     action(item);
     ItemDrop itemDrop = item.GetComponent<ItemDrop>();
     if (itemDrop != null)
     {
         for (int i = 0; i < itemDrop.ChildItemDragList.Count; ++i)
         {
             CallDelegateItemRaycast(itemDrop.ChildItemDragList[i].GetComponent<Item>(), action);
         }
     }
 }
 public override bool ContainsItem(Item item)
 {
     SplineReplicator replicator = SplineReplicatorList.Find(r => r.Item == item);
     if (replicator == null)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
 public override Ray Snap(Item item, PointerEventData data)
 {
     ItemDrag dragItem = item.GetComponent<ItemDrag>();
     if (dragItem.AttachPointArray != null && dragItem.AttachPointArray.Length > 0)
     {
         for (int i = 0; i < dragItem.AttachPointArray.Length; ++i)
         {
             if (ItemUtility.TestTagArrays(dragItem.AttachPointArray[i].TagArray, ChildTagArray))
             {
                 return new Ray(transform.position - dragItem.AttachPointArray[i].transform.localPosition, -transform.forward);
             }
         }
         return new Ray(transform.position, -transform.forward);
     }
     else
     {
         return new Ray(this.transform.position, -transform.forward);
     }
 }
        /// <summary>
        /// Adds the item raycast or updates it if already in list.
        /// </summary>
        /// <returns> Returns the midpoint of where Item was Added. </returns>
        /// <param name="itemRaycast">Item raycast.</param>
        /// <param name="hitPoint">Hit point.</param>
        public Vector3 UpdateItem(Item item, Vector3 hitPoint)
        {
            //Retieve or Create a new duplicate data
            SplineReplicator replicator = SplineReplicatorList.Find(r => r.Item == item);

            SplineReplicatorList.Remove(replicator);

            SetStartEndPoint();

            Ray lineRay = AttachPointRay();

            Vector3 linePoint = Math3D.ProjectPointOnLine(lineRay.origin, lineRay.direction, hitPoint);

            InsertReplicator(replicator, linePoint);

            SetStartEndPoint();
            SetColliderSize();

            return replicator.DuplicateRangeMidPoint();
        }
 public abstract void RemoveItem(Item item);
 /// <summary>
 /// Returns if this snap already contains a given item.
 /// </summary>
 /// <returns><c>true</c>, if item was containsed, <c>false</c> otherwise.</returns>
 /// <param name="item">Item.</param>
 public abstract bool ContainsItem(Item item);
 public abstract void AddItem(Item item);
 private int CallDelegateTagFilterItemRaycast(Item item, System.Func<Item,bool> filterAction, System.Action<Item> trueAction, System.Action<Item> falseAction)
 {
     int trueCount = 0;
     if (filterAction(item))
     {
         trueAction(item);
         trueCount = 1;
     }
     else if (falseAction != null)
     {
         falseAction(item);
     }
     ItemDrop itemDrop = item.GetComponent<ItemDrop>();
     if (itemDrop != null)
     {
         for (int i = 0; i < itemDrop.ChildItemDragList.Count; ++i)
         {
             trueCount += CallDelegateTagFilterItemRaycast(itemDrop.ChildItemDragList[i].GetComponent<Item>(), filterAction, trueAction, falseAction);
         }
     }
     return trueCount;
 }
 public override bool ContainsItem(Item item)
 {
     return ChildItemList.Contains(item);
 }
 public override void AddItem(Item item)
 {
     SplineReplicator replicator = gameObject.AddComponent<SplineReplicator>();
     replicator.Item = item;
     SplineReplicatorList.Add(replicator);
 }
 public bool ContainsItem(Item containedItem)
 {
     for (int i = 0; i < ItemSnapArray.Length; ++i)
     {
         if (ItemSnapArray[i].ContainsItem(containedItem))
         {
             return true;
         }
     }
     return false;
 }
 public override void RemoveItem(Item item)
 {
     ChildItemList.Remove(item);
 }
 /// <summary>
 /// Gets the point to snap to.
 /// </summary>
 public abstract Ray Snap(Item item, PointerEventData data);
 private void RemoveUniqueTickRecursive(Item item)
 {
     Root.UniqueTickDictionary.Remove(item.UniqueTick);
     ItemDrop item_Drop = item.GetComponent<ItemDrop>();
     if (item_Drop != null)
     {
         for (int i = 0; i < item_Drop.ItemSnapArray.Length; ++i)
         {
             Root.UniqueTickDictionary.Remove(item_Drop.ItemSnapArray[i].UniqueTick);
         }
     }
     ItemDrop itemDrop = item.GetComponent<ItemDrop>();//TODO WHY IS THIS TWICE??
     if (itemDrop != null)
     {
         for (int i = 0; i < itemDrop.ChildItemDragList.Count; ++i)
         {
             RemoveUniqueTickRecursive(itemDrop.ChildItemDragList[i].GetComponent<Item>());
         }
     }
 }
 public override void AddItem(Item item)
 {
     ChildItemList.Add(item);
 }