示例#1
0
        //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        //                                                                                                                        HandleClickButton()
        //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        void HandleClickButton()
        {
            if (Input.GetMouseButtonUp(0))
            {
                if (_restart_button.HitTestPoint(Input.mouseX, Input.mouseY))
                {
                    RestartGame();
                }

                if (_credits_button.HitTestPoint(Input.mouseX, Input.mouseY))
                {
                    CreateCreditsMenu();
                }

                if (_main_menu_button.HitTestPoint(Input.mouseX, Input.mouseY))
                {
                    GoBackToStartMenu();
                }
            }
        }
示例#2
0
        //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        //                                                                                                                        HandleClickButton()
        //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        void HandleClickButton()
        {
            if (Input.GetMouseButtonUp(0))
            {
                if (_start_button.HitTestPoint(Input.mouseX, Input.mouseY))
                {
                    CreateGame();
                }

                if (_credits_button.HitTestPoint(Input.mouseX, Input.mouseY))
                {
                    CreateCredits();
                }

                if (_quit_button.HitTestPoint(Input.mouseX, Input.mouseY))
                {
                    MyGame mygame = game as MyGame;
                    mygame.quitIsPressed = true;

                    MyGame.timeSince = Time.now;
                }
            }
        }