Example #1
0
 private void Show(ToastItem item, ItemData data)
 {
     m_toastInterval = TOAST_INTERVAL_MAX;
     item.Show(data.text, data.isFailMsg);
     for (int i = 0; i < m_toastList.Count; i++)
     {
         if (!m_toastList[i].isShow)
         {
             m_toastInterval = TOAST_INTERVAL_MIN;
             continue;
         }
         if (m_toastList[i] != item)
         {
             m_toastList[i].Move(Vector2.up * 60f);
         }
     }
 }
Example #2
0
        public override void OnInit()
        {
            m_toastList.Clear();
            for (int i = 0; i < 5; i++)
            {
                GameObject go = Instantiate(template) as GameObject;
                UIHelper.SetParent(itemRoot, go.transform);
                ToastItem item = go.GetComponent <ToastItem>();
                m_toastList.Add(item);
                go.SetActive(false);
            }


            GameObject st_go = Instantiate(standloneTemplate) as GameObject;

            UIHelper.SetParent(itemRoot, st_go.transform);
            m_toastStandalone = st_go.GetComponent <ToastItemStandalone>();
        }