예제 #1
0
    }                                                                                                        //end of Fixed Update

    /*
     *	FUNCTION: Check if pause button is tapped in-game
     *	CALLED BY:	Update()
     */
    private void getClicks()
    {
        if (Input.GetMouseButtonUp(0) && bMouseReleased == true)
        {
            Vector3 screenPoint;
            Vector2 buttonSize;
            Rect    Orb_Rect;

            if (tHUDGroup.localPosition.z == 0)
            {
                buttonSize  = new Vector2(Screen.width / 6, Screen.width / 6);
                screenPoint = HUDCamera.WorldToScreenPoint(tPauseButton.position);

                Orb_Rect = new Rect(screenPoint.x - (buttonSize.x * 0.5f), screenPoint.y - (buttonSize.y * 0.5f), buttonSize.x, buttonSize.y);
                if (Orb_Rect.Contains(Input.mousePosition))
                {
                    hInGameScriptCS.pauseGame();
                }
            }

            //Orb_Rect = new Rect (screenPoint.x - ( buttonSize.x * 0.5f ), screenPoint.y - ( buttonSize.y * 0.5f ), buttonSize.x, buttonSize.y);
        } //end of mouserelease == true if
    }     //end of get clicks function
예제 #2
0
 void OnClick()
 {
     hInGameScriptCS.pauseGame();
 }