void OnGUI() { GUI.depth = 2; GUI.skin.label.fontSize = fontSize; /*/Test Button * var testRect = new Rect (100, 100, 100, 100); * GUI.Button (testRect, "Sphere Right"); * Vector2 pos = cursorController.GetCursorPosition (); * if(testRect.Contains(pos) && cursorController.CursorClicked()) //if cursor over button and clicked * { * GameObject temp = GameObject.Find ("TestSphere"); * Vector3 vec = temp.transform.position; * vec.x += 0.1f; * temp.transform.position = vec; * } * //End Test Button*/ Vector2 pos = cursorController.GetCursorPosition(); Vector2 dupePos = pos; dupePos.x += Screen.width / 2; //Test Scrollview var testWinRect = new Rect(100, 400, 200, 200); scrollPosition = GUI.BeginScrollView(testWinRect, scrollPosition, new Rect(0, 0, 190, 400)); if (testWinRect.Contains(pos)) //if cursor over window { if (Input.GetAxis("Scroll Y") != 0) { if (Input.GetAxis("Scroll Y") > 0 && scrollPosition.y < 400) { GUI.ScrollTo(new Rect(0, scrollPosition.y + 5.0f, 200, 200)); } else if (Input.GetAxis("Scroll Y") < 0 && scrollPosition.y > 0) { GUI.ScrollTo(new Rect(0, scrollPosition.y - 10.0f, 200, 200)); } } } scrollText = GUI.TextArea(new Rect(0, 0, 200, 200), scrollText); GUI.EndScrollView(); var testWinRectDupe = new Rect(testWinRect); testWinRectDupe.x += Screen.width / 2; scrollPosition2 = GUI.BeginScrollView(testWinRectDupe, scrollPosition2, new Rect(0, 0, 190, 400)); if (testWinRectDupe.Contains(dupePos)) //if cursor over window { if (Input.GetAxis("Scroll Y") != 0) { if (Input.GetAxis("Scroll Y") > 0 && scrollPosition2.y < 400) { GUI.ScrollTo(new Rect(0, scrollPosition2.y + 5.0f, 200, 200)); } else if (Input.GetAxis("Scroll Y") < 0 && scrollPosition2.y > 0) { GUI.ScrollTo(new Rect(0, scrollPosition2.y - 10.0f, 200, 200)); } } } scrollText = GUI.TextArea(new Rect(0, 0, 200, 200), scrollText); GUI.EndScrollView(); //End Test Scrollview //Test Windows windowRectDupe = new Rect(windowRect); windowRectDupe.x += Screen.width / 2; if (showWindow) { //windowRect = new Rect(20, 200, 200, 200); windowRect = GUI.Window(windowIDnum, windowRect, WindowFunction, windowLabel); windowRectDupe = GUI.Window(windowIDnum + 1, windowRectDupe, WindowFunction, windowLabel); } else { //windowRect = new Rect(); } //End Test Windows }