Ejemplo n.º 1
0
    public override void Awake()
    {
        m_ScreenStack   = new Stack <ScreenId>();
        m_PopupStack    = new Stack <UIPopupData>();
        m_CurrentScreen = null;
        m_CurrentPopup  = null;

        Debug.AssertFormat(ValidateManager() != false, "{0} : Failed to validate, please ensure that all required components are set and not null.", UIManager.Identifier);

        m_Prompts = m_PromptsCanvas.GetComponent <UIPrompts>();

        base.Awake();
    }
Ejemplo n.º 2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="popup"></param>
    public void ShowNextPopup()
    {
        // Close any existing popups.
        ClosePopup();

        if (m_PopupStack.Count > 0)
        {
            InputManager.Instance.SetInputType("UI");

            UIPopupData nextPopup = m_PopupStack.Pop();
            m_CurrentPopup = GameObject.Instantiate <UIBasePopup>(m_GenericPopupPrefab, m_PopupCanvas.transform);
            m_CurrentPopup.SetData(nextPopup);
            m_CurrentPopup.Initialize();

            m_PopupLayer.SetActive(true);
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    ///
    /// </summary>
    public void ClosePopup()
    {
        if (m_CurrentPopup != null)
        {
            m_CurrentPopup.Shutdown();
            GameObject.Destroy(m_CurrentPopup.gameObject);
            m_CurrentPopup = null;

            // Show the next popop
            if (m_PopupStack.Count > 0)
            {
                ShowNextPopup();
            }
            else
            {
                InputManager.Instance.SetInputType("Default");
                m_PopupLayer.SetActive(false);
            }
        }
    }