Ejemplo n.º 1
0
    private bool IsGUIMousePosition()
    {
        Vector2 gUIMousePosition = NgLayout.GetGUIMousePosition();
        Rect    rect             = new Rect(0f, 0f, (float)Screen.width, (float)(Screen.height / 10 + 30));

        if (rect.Contains(gUIMousePosition))
        {
            return(true);
        }
        Rect rect2 = new Rect(0f, 0f, 40f, (float)Screen.height);

        return(rect2.Contains(gUIMousePosition));
    }
Ejemplo n.º 2
0
    bool IsGUIMousePosition()
    {
        Vector2 pos = NgLayout.GetGUIMousePosition();

        if (new Rect(0, 0, Screen.width, Screen.height / 10 + 30).Contains(pos))
        {
            return(true);
        }
        if (new Rect(0, 0, 40, Screen.height).Contains(pos))
        {
            return(true);
        }
        return(false);
    }
Ejemplo n.º 3
0
    bool IsGUIMousePosition()
    {
        Vector2 pos = NgLayout.GetGUIMousePosition();

        if (FxmTestMain.inst.GetFXMakerControls().GetActionToolbarRect().Contains(pos))
        {
            return(true);
        }
        if (new Rect(0, 0, Screen.width, Screen.height / 10 + 30).Contains(pos))
        {
            return(true);
        }
        if (new Rect(0, 0, 40, Screen.height).Contains(pos))
        {
            return(true);
        }
        return(false);
    }
Ejemplo n.º 4
0
    private bool IsGUIMousePosition()
    {
        Vector2 gUIMousePosition = NgLayout.GetGUIMousePosition();

        if (FxmTestMain.inst.GetFXMakerControls().GetActionToolbarRect().Contains(gUIMousePosition))
        {
            return(true);
        }
        Rect rect = new Rect(0f, 0f, (float)Screen.width, (float)(Screen.height / 10 + 30));

        if (rect.Contains(gUIMousePosition))
        {
            return(true);
        }
        Rect rect2 = new Rect(0f, 0f, 40f, (float)Screen.height);

        return(rect2.Contains(gUIMousePosition));
    }
Ejemplo n.º 5
0
    public static int GetGridHoverIndex(Rect windowRect, Rect listRect, Rect gridRect, int nCount, int nColumn, GUIStyle style)
    {
        int     num   = (style != null) ? style.margin.left : 0;
        int     num2  = nCount / nColumn + ((0 >= nCount % nColumn) ? 0 : 1);
        float   num3  = gridRect.width / (float)nColumn;
        float   num4  = gridRect.height / (float)num2;
        Vector2 point = NgLayout.GetGUIMousePosition() - new Vector2(windowRect.x, windowRect.y);

        if (!listRect.Contains(point))
        {
            return(-1);
        }
        for (int i = 0; i < nCount; i++)
        {
            Rect rect = new Rect(listRect.x + num3 * (float)(i % nColumn) + (float)num, listRect.y + num4 * (float)(i / nColumn) + (float)num, num3 - (float)(num * 2), num4 - (float)(num * 2));
            if (rect.Contains(point))
            {
                return(i);
            }
        }
        return(-1);
    }