/// <summary> /// Opens the modal window specified by name with the specified settings /// </summary> /// <param name="settings">The settings for the modal window</param> /// <param name="windowName">The name of the modal window to use (Prefab name)</param> public void ShowModalWindow(ModalWindowSettings settings, string windowName) { if (_activeModalWindow == null || !_activeModalWindow.gameObject.activeInHierarchy || settings.overrideActiveModalWindow) //make sure there isn't already a modal window { UIModalWindow w = _modalWindows.FirstOrDefault(x => x.name == windowName); if (w != null) { CloseActiveModalWindow(); ShowModalWindow(settings, w); } else { Debug.LogWarning("Cannot find modal window with name '" + windowName + "'"); } } else { Debug.LogWarning("There already is an active modal window."); } }
private void ShowModalWindow(ModalWindowSettings settings, UIModalWindow window) { _activeModalWindow = window; window.OpenModalWindow(settings); HideTooltip(); }