Code that is perfectly working in the game mode is not fully working on my iOS device. The modal window seems to be active, as interaction with other elements is not possible anymore. The window function is called, I checked this with a debug statement. But the window is not shown.
private GUI.WindowFunction currentWindowFunction;
private Rect currentWindowRect;
private int currentWindowId;
private bool shouldRenderPopup;
private string currentWindowTitle;
private float fade;
//...
void OnGUI ()
// ...
bool toSettingsButtonPressed = GUI.Button (new Rect (900, 600, 44, 44), settingsButtonTex);
if (toSettingsButtonPressed) {
currentWindowFunction = SettingsWindow;
currentWindowRect = settingsWindowRect;
currentWindowId = settingsWindowId;
currentWindowTitle = "Einstellungen";
shouldRenderPopup = true;
fade = 0;
}
Debug.Log("modal " + GUIUtility.hasModalWindow);
if (shouldRenderPopup) {
fade = Mathf.Clamp (fade += 0.01f, 0f, 1f);
GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, fade);
settingsWindowRect = GUI.ModalWindow(currentWindowId, currentWindowRect, currentWindowFunction, currentWindowTitle);
}
// ...
↧