Message boxes, had some time put in creating some for my program, now it all were informative message boxes where an OK button was available and then it closed.
I worked with a canvas that would be enabled when needed and gets disabled on clicking OK.
But now I'm in need of a messagebox that gives an output. I've tried to do the same and test some stuff with public variables, but my code kept going and didn't wait for the response of the "dialogue box" which results in the changes going through and an unused canvas that opened behind my active screen. (Another canvas is loaded when running the code while the current canvas gets disabled).
Code example:
cnvCleanup.enabled = true;
//Here it should wait till i have "answered" on cnvCleanup
if (CleanUpDone == true)
{
usages = 0;
}
else
{
usages++;
The cnvCleanup will get disabled on the script I wrote for clicking on the OK button. In case the Not OK button is clicked the bool CleanUpDone should remain false so there the cnv gets disabled.
EDIT: More code.
The CleanUpDoneis public bool CleanUpDone;
that gets changed in the cnvCleanup.
int usages;
usages = System.Int32.Parse(AssetList[2]);
if (usages < 10)
{
usages++;
AssetList[2] = usages.ToString();
}
else
{
cnvCleanup.enabled = true;
//Here it should wait till i have "answered" on the cnvCleanup
if (CleanUpDone == true)
{
usages = 0;
AssetList[2] = usages.ToString();
}
else
{
usages++;
}
}