예제 #1
0
    public ToolSelectMenu(GuiManager gameMenuManager)
    {
        background = Resources.Load(ResourcePaths.toolSelectBackground) as Texture;
        tipStyle   = GuiFunctions.getTipStyle();

        gmm = gameMenuManager;

        int xSpace = Screen.width / 6;
        int ySpace = Screen.height / 6;

        backgroundRect = new Rect(xSpace, ySpace, Screen.width - xSpace * 2, Screen.height - ySpace * 2);

        guiRect = new Rect(backgroundRect.xMin + Screen.width / 40, backgroundRect.yMin + Screen.height / 40,
                           backgroundRect.width - Screen.width / 20, backgroundRect.height - Screen.height / 20);

        float toolIconSize  = guiRect.width / 5;
        float mouseIconSize = toolIconSize / 2;

        toolIconSpacing = toolIconSize / 4;
        toolGuiOptions  = new GUILayoutOption[2] {
            GUILayout.Width(toolIconSize), GUILayout.Height(toolIconSize)
        };
        mouseGuiOptions = new GUILayoutOption[2] {
            GUILayout.Width(mouseIconSize), GUILayout.Height(mouseIconSize)
        };
    }