Hi! I just want to ask if is it possible to disable camera control when a GUI is active? If so, how? Thanks in advance!
I have this code below.
`
var toggleGUI : boolean;
var page: float;
var asd: String = "";
var mov: String = "";
var oimg: Texture;
var nimg: Texture;
var scrollPosition : Vector2;
function OnMouseDown () {
toggleGUI = true;
}
function OnGUI (){
if (toggleGUI) {
GUI.Box(new Rect(50,50,Screen.width/2+250,Screen.height/2+200), "Choose one");
if(GUI.Button(new Rect(51,70,120,50), "Text Information")){
page = 1;
}
if(GUI.Button(new Rect(180,70, 100, 50), "Video")){
page = 2;
}
if(GUI.Button(new Rect(290,70, 100, 50), "Images")){
page = 3;
}
if(GUI.Button(new Rect(Screen.width/2+200,70,100,50), "X")){
page=0;
toggleGUI=false;
}
if(page == 1){
scrollPosition = GUI.BeginScrollView (Rect(60,150,625,300),
scrollPosition, Rect (60, 150, 605, Screen.height+200));
GUI.TextArea(new Rect(60, 150, 605, Screen.height+200), asd);
GUI.EndScrollView();
}
if(page == 2){
if(GUI.Button(new Rect(60,150,100,40), "Play Movie")){
Handheld.PlayFullScreenMovie (mov, Color.black, FullScreenMovieControlMode.CancelOnInput);
}
}
if(page == 3){
if(GUI.Button(new Rect(60,150,100,40), "Old Image")){
page = 3.1;
}
if(GUI.Button(new Rect(180,150,100,40), "New Image")){
page = 3.2;
}
}
if(page==3.1){
GUI.Label(new Rect(60,150,Screen.width/2+200,Screen.width/8+200), oimg);
}
if(page==3.2){
GUI.Label(new Rect(60,150,Screen.width/2+200,Screen.width/8+200), nimg);
}
}
}
`
The problem is that whenever the user interacts with the scrollbar, the map beneath it also moves. What should I do?