CanAttach() public method

public CanAttach ( string tagArray ) : bool
tagArray string
return bool
        public void ItemButtonClick(int itemArrayIndex)
        {
            if (_selectedItemIndex != itemArrayIndex)
            {
                UnselectSelectedItem();

                _selectedItemIndex = itemArrayIndex;

                _selectedItem = _currentlyLoadedItemArray[itemArrayIndex];

                System.Action <Item> trueAction = delegate(Item item)
                {
                    item.SetShaderOutline(_itemSettings.InstantiateOutlineColor);
                    item.State = ItemState.Instantiate;
                };
                System.Action <Item> falseAction = delegate(Item item)
                {
                    item.SetShaderNormal();
                    item.State = ItemState.NoInstantiate;
                };
                System.Func <Item, bool> filterAction = delegate(Item item)
                {
                    ItemDrop     itemDrop  = item.GetComponent <ItemDrop>();
                    ItemColor    itemColor = item.GetComponent <ItemColor>();
                    const string colorTag  = "Color";
                    if (itemDrop != null)
                    {
                        return(itemDrop.CanAttach(_selectedItem.TagArray));
                    }
                    if (itemColor != null && _selectedItem.HasTag(colorTag))
                    {
                        return(true);
                    }
                    return(false);
                };

                int trueCount = Root.CallDelegateTagFilter(filterAction, trueAction, falseAction);

                if (trueCount == 0)
                {
                    _selectedItem = null;
                    Root.SetAllOutlineNormalAttach();
                    _selectedItemIndex = -1;
                }
                else
                {
                    System.Action action = delegate()
                    {
                        UnselectSelectedItem();
                    };
                    _catcher.EmptyClickAction = action;

                    ItemBarHorizontalGroupItemList[_selectedItemIndex].GetComponent <Transform>().FindChild("ItemBarItemHighlight").GetComponent <Image>().enabled = true;
                }
            }
            else
            {
                UnselectSelectedItem();
            }
        }
        private void OnPointerUpInstantiate(PointerEventData data)
        {
                        #if LOG
            Debug.Log("OnPointerUpAttachedHighlighted " + this.name);
                        #endif

            VisualizationUI plannerUI            = FindObjectOfType <VisualizationUI>();
            Item            instantiatedItem     = plannerUI.InstantiateSelectedItem(data);
            ItemDrag        instantiatedItemDrag = instantiatedItem.GetComponent <ItemDrag>();
            ItemDrop        itemDrop             = GetComponent <ItemDrop>();
            if (itemDrop != null)
            {
                instantiatedItemDrag.ThisEnteredDropItem = itemDrop;
                instantiatedItemDrag.ParentItemDrop      = itemDrop;

                ItemSnap itemSnap = instantiatedItemDrag.NearestItemSnap(data);
                instantiatedItemDrag.ParentItemSnap = itemSnap;
                Ray ray = itemSnap.Snap(instantiatedItem, data);
                instantiatedItemDrag.SetTargetPositionRotation(ray.origin, ray.direction);
                //set to outline and normal to get rid of quirk where instantied shader isn't immediately properly lit
                instantiatedItem.SetShaderOutline(_itemSettings.InstantiateOutlineColor);
                instantiatedItem.SetShaderNormal();
                instantiatedItem.State = ItemState.NoInstantiate;

                //TODO this should always be able to attach, why are we checking?
                if (itemDrop.CanAttach(instantiatedItem.TagArray))
                {
                    SetShaderOutline(_itemSettings.InstantiateOutlineColor);
                }
                else
                {
                    SetShaderNormal();
                    State = ItemState.NoInstantiate;
                }
            }
            ItemColor itemColor = GetComponent <ItemColor>();
            if (itemColor != null)
            {
                Item item = GetComponent <Item>();
                item.SetBlendMaterial(instantiatedItem.MaterialArray[0].mainTexture);
                SetShaderNormal();
                State = ItemState.NoInstantiate;
                StartCoroutine(instantiatedItem.DestroyItemCoroutine());
            }
        }