- Home /
[Solved] Built in GUI continuously Loads through different Options.
Is there any way that I can break a Loop just in the GUI code? It just continuously loads from my GameControl script as to where I cannot change any options, as I change some of these options, it quickly reverts back to the saved method which I believe quickly reloads continuously.
I have switch case for my buttons:
void OnGUI() {
switch(menuSelection) {
case 0:
windowRect=GUI.Window(0, windowRect, SPOptionsWindow, "Singleplayer Options");
//This is where I would like to have the different load options for different settings from $$anonymous$$ultiplayer.
GameControl.control.LoadSP();
break;
case 1:
$$anonymous$$POptionsButton();
//This is where I would like to have the different load options for different settings from Singleplayer.
GameControl.control.Load$$anonymous$$P();
break;
default:
//Not sure what goes here/Error Handling?
break;
}
}
Now it loads up the different settings just fine, however I can't get it to allow me to change these settings once they've loaded.
what do $$anonymous$$POptionsButton()
, LoadSP()
& Load$$anonymous$$P()
do? when you say it won't allow you to change the settings, what are you trying? there's not enough info in the question/code to explain it
I didn't add it because they are just methods that are called. The problem that I'm having is in the Switch/Case or it's because of the built in GUI. Perhaps we can do a screenshare?
Then maybe you can better understand.
Answer by jeThomas · Oct 26, 2014 at 08:02 AM
Basically (Even though I had switched to the New UI) this is still required. I had to create two GameControl objects, one simply called spGameControl, and the other mpGameControl. While keeping both in play and if it loads the Singleplayer Game; then it just simply uses the spGameControl while the mpGameControl is just sitting in the air of the scene. Just existing. I'm sure there is a way to destroy certain game control objects once the scene is loaded, I just don't know how to do all of that yet lol. But I hope this helps anyone looking for the answer.
Your answer
Follow this Question
Related Questions
Save and load serialization problem 0 Answers
Multiple Cars not working 1 Answer
My save function saves the wrong values!! 1 Answer
create text file in C#. 2 Answers
How to use StreamReader in my case 1 Answer