예제 #1
0
파일: MainMenu.cs 프로젝트: miberen/Game
    // Use this for initialization
    void Start()
    {
        screenWidth  = Screen.width;
        screenHeight = Screen.height;
        buttonWidth  = 150.0f;
        buttonHeight = 30.0f;

        menuDelegate = TopMenu;
    }
예제 #2
0
파일: MainMenu.cs 프로젝트: miberen/Game
    private void TopMenu()
    {
        GUI.skin.label.alignment = TextAnchor.MiddleCenter;
        GUI.Label(new Rect((screenWidth / 2) - (buttonWidth / 2), (screenHeight / 2) - (buttonHeight / 2) - 80, buttonWidth, buttonHeight), "Menu");

        if (GUI.Button(new Rect((screenWidth / 2) - (buttonWidth / 2), (screenHeight / 2) - (buttonHeight / 2) - 40, buttonWidth, buttonHeight), "Start New Game"))
        {
            menuDelegate = NewGameMenu;
        }

        if (GUI.Button(new Rect((screenWidth / 2) - (buttonWidth / 2), (screenHeight / 2) - (buttonHeight / 2), buttonWidth, buttonHeight), "Options"))
        {
            //StartGame();
        }

        if (GUI.Button(new Rect((screenWidth / 2) - (buttonWidth / 2), (screenHeight / 2) - (buttonHeight / 2) + 40, buttonWidth, buttonHeight), "Quit Game"))
        {
            Application.Quit();
        }
    }