Esempio n. 1
0
        public void ShowPopUp(string a_Message, PopUpType a_type)
        {
            SliderData newData = new SliderData();

            newData.Message      = a_Message;
            newData.PopUpSetting = a_type;

            runtimeList.Add(newData);
        }
Esempio n. 2
0
        private void SetDataInPanel()
        {
            SliderData sd = runtimeList.Items[0];

            m_Text.text = sd.Message;

            if (sd.PopUpSetting.PanelBase)
            {
                m_panelImage.sprite = sd.PopUpSetting.PanelBase;
            }
            else
            {
                m_panelImage.sprite = basePanel;
                m_panelImage.color  = baseColor;
            }

            m_panelImage.color = sd.PopUpSetting.PanelColor;

            Vector2 t = m_Text.rectTransform.offsetMin;

            if (m_DrawIcon && sd.PopUpSetting.DrawImage)
            {
                m_Sprite.sprite = sd.PopUpSetting.Image;
                m_Sprite.gameObject.SetActive(true);

                t = offset;
                m_Text.rectTransform.offsetMin = t;
            }
            else
            {
                m_Sprite.gameObject.SetActive(false);
                t.x = 15;
                m_Text.rectTransform.offsetMin = t;
            }

            // other customizations
            m_Text.fontStyle = sd.PopUpSetting.Style;

            SlideIn();
        }
Esempio n. 3
0
        // Update is called once per frame
        void Update()
        {
            if (runtimeList.GetCount() > 0 && messageComplete)
            {
                m_currentTime -= Time.deltaTime;

                if (m_currentTime <= 0.0f)
                {
                    m_currentTime = m_maxTimeForPopup;

                    SliderData sd = runtimeList.Items[0];
                    m_Text.text = sd.Message;

                    Vector2 t = m_Text.rectTransform.offsetMin;
                    if (m_DrawIcon)
                    {
                        m_Sprite.sprite = sd.PopUpSetting.Image;
                        m_Sprite.gameObject.SetActive(true);

                        t = offset;
                        m_Text.rectTransform.offsetMin = t;
                    }
                    else
                    {
                        m_Sprite.gameObject.SetActive(false);
                        t.x = 5;
                        m_Text.rectTransform.offsetMin = t;
                    }

                    // other customizations
                    m_Text.fontStyle = sd.PopUpSetting.Style;

                    SlideIn( );
                }
            }
        }