示例#1
0
    private void ResetMouseUpDelegate()
    {
        MouseUpCalls = null;

        // Start by calling mouse up on any element that is no longer being hovered but had (and still has) it's mouse down & up calls linked
        for (int i = 0; i < mouseTrackerLinkedSet.Count; i++)
        {
            if (mouseTrackerLinkedSet[i].LinkMouseUpToDown)
            {
                MouseUpCalls += mouseTrackerLinkedSet[i].MouseUpCB;
            }
        }

        // Add the rest of the hovered mouse up calls
        for (int i = 0; i < mouseTrackerEnteredSet.Count; i++)
        {
            if (!mouseTrackerLinkedSet.Contains(mouseTrackerEnteredSet[i]))
            {
                MouseUpCalls += mouseTrackerEnteredSet[i].MouseUpCB;
            }
            if (mouseTrackerEnteredSet[i].clickThrough == false)
            {
                break;
            }
        }
    }
示例#2
0
    private void AddToSet()
    {
        if (mouseTrackerFullSet.Contains(this))
        {
            return;
        }

        int insertionPnt = -1;

        for (int i = 0; i < mouseTrackerFullSet.Count; i++)
        {
            if (SB.IsCloserThan(mouseTrackerFullSet[i].SB))
            {
                insertionPnt = i;
                break;
            }
        }
        if (insertionPnt > -1)
        {
            mouseTrackerFullSet.Insert(insertionPnt, this);

            // TODO - Maybe find a more direct/quicker approach to correcting this set.
            if (containsMousePoint)
            {
                ResetEnteredSet();
            }
        }
        else
        {
            mouseTrackerFullSet.Add(this);
            if (containsMousePoint)
            {
                mouseTrackerEnteredSet.Add(this);
            }
        }


        //for (int i = 0; i < refShapeMouseTrackerSet.Count; i++)
        //    Debug.Log(refShapeMouseTrackerSet[i]);
    }