Exemplo n.º 1
0
    public void OnPointerUp(PointerEventData eventData)
    {
        if (downButton != null)
        {
            if (lastEnter != null)
            {
                lastEnter.Unhover();

                if (downButton != lastEnter)
                {
                    var node = board.GetOffsetNode(lastEnter.XIndex, lastEnter.YIndex);
                    if (node != null)
                    {
                        if (AreNextToo(lastEnter, downButton))
                        {
                            if (NodeSwipeOccurred != null)
                            {
                                NodeSwipeOccurred(downButton, lastEnter, MathUtils.ClosestCardinal(eventData.position - pointDown));
                            }
                        }
                    }
                    else
                    {
                        //RaiseSwipeOccurred(eventData);
                    }
                    downButton.Deselect();
                }
                else
                {
                    downButton.Hover();
                    lastEnter = downButton;
                    //RaiseSwipeOccurred(eventData);
                }
            }
            else
            {
                downButton.Deselect();
                //RaiseSwipeOccurred(eventData);
            }
        }
        else
        {
            RaiseSwipeOccurred(eventData);
        }

        downButton = null;
    }
Exemplo n.º 2
0
 private void OnSwipeOccurred(Vector2 dir)
 {
     CurrentBoard.Behavior.Spin(dir);
     if (_downButton == null)
     {
         return;
     }
     _downButton.Deselect();
     _downButton = null;
 }