Example #1
0
    private void DrawMenu()
    {
        if (IsVisible)
        {
            group_height = 300;

            box_height   = group_height;
            group_y      = (int)(Screen.height / 2 - group_height / 2);
            draw_point_y = (int)(box_height * 0.1f);


            GUI.BeginGroup(new Rect(group_x, group_y, group_width, box_height));
            GUI.DrawTexture(new Rect(box_x, box_y, box_widht, box_height), menu_Texture);
            step_y = draw_point_y;

            string[]        names;
            PerformMethod[] methods = new PerformMethod[] { Continue, Replay, Quit }; // { Continue,Replay, goInMenu, Quit };

            if (gameHandler.statusGame == GameHandler.Status.Pause)
            {
                names = new string[] { "Continue", "Playe Agin", "Quit" }; //{ "Continue","Playe Agin", "Menu", "Quit" };
                DrawButtons(names, methods);
            }


            GUI.EndGroup();
        }
    }
Example #2
0
    private void DrawFullSceenMenu()
    {
        group_height = Screen.height;
        box_height   = group_height;
        group_y      = 0;
        draw_point_y = (int)(box_height / 2 - (box_height / 2) * 0.1f); // c_y - c_y / 20%


        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), background_Texture);
        GUI.BeginGroup(new Rect(group_x, group_y, group_width, box_height));
        GUI.DrawTexture(new Rect(box_x, box_y, box_widht, box_height), menu_Texture);
        step_y = draw_point_y;

        string[]        names;
        PerformMethod[] methods = new PerformMethod[] { Replay, Quit };// { Replay, goInMenu, Quit };
        string[]        texts;
        if (gameHandler.statusGame == GameHandler.Status.Win)
        {
            names = new string[] { "Playe Agin", "Quit" };
            texts = new string[] { "You Win", "Result: " + gameHandler.GamePoints.ToString() };
            DrawLables(texts);
            DrawButtons(names, methods);
        }
        else if (gameHandler.statusGame == GameHandler.Status.lose)
        {
            names = new string[] { "Try Agin", "Quit" };
            texts = new string[] { "Game Over", "Result: " + gameHandler.GamePoints.ToString() };
            DrawLables(texts);
            DrawButtons(names, methods);
        }


        GUI.EndGroup();
    }