Hi ,guys
Using GUI,
i create a DragWindow in the scene
"
private Rect winRect;
// Use this for initialization
void Start () {
winRect = new Rect(10, 10, 300, 100);
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
winRect=GUI.Window(0,winRect,windowsFUN,“the first windows”);
}
void windowsFUN(int windowID)
{
GUI.DragWindow(new Rect(0,0,300,100));
}
"
+____
one cube only attach with this script
"
void Update () {
if (Input.GetMouseButtonUp(0))
{
RaycastHit hit;
if (Physics.Raycast(Camera.mainCamera.ScreenPointToRay(Input.mousePosition), out hit, 100))
{
Debug.Log("over the Box "+hit.collider.name);
}
}
"
the question is that when i put the window just over the cube, and click inside the window
the console keeps printing “over the Box XXX”
what i want is that ,when i put the window over the cube ,i click the mouse left button,the Raycast shoud not work. because there 's window is just over the cube.
Is there some solutions for that ?