Exemplo n.º 1
0
    private Vector2 GetSnapPositionForButton(CornerButton button)
    {
        EditorDebug.LogWarning("GetSnapPositionsForButton need to be implemented again");
        // left
        if (button.Position.x < 480) {
            if (button.Position.y > 320) {
                button.verticalFloat = Frame.VerticalFloatPositions.bottom;
                button.horizontalFloat = Frame.HorizontalFloatPositions.left;
                button.UpdateElement();
                button.removeFloat();
                //return new Vector2(0, 640 - button.VirtualRegionOnScreen.height);

            } else {
                button.verticalFloat = Frame.VerticalFloatPositions.top;
                button.horizontalFloat = Frame.HorizontalFloatPositions.left;
                button.UpdateElement();
                button.removeFloat();

            }
        } else {
            if (button.Position.y > 320) {
                button.verticalFloat = Frame.VerticalFloatPositions.bottom;
                button.horizontalFloat = Frame.HorizontalFloatPositions.right;
                button.UpdateElement();
                button.removeFloat();
                //return new Vector2(960 - button.VirtualRegionOnScreen.width, 640 - button.VirtualRegionOnScreen.height);
            } else {
                button.verticalFloat = Frame.VerticalFloatPositions.top;
                button.horizontalFloat = Frame.HorizontalFloatPositions.right;
                button.UpdateElement();
                button.removeFloat();
                //return new Vector2(960 - button.VirtualRegionOnScreen.width, 0);
            }
        }
        return button.Position;
    }