Esempio n. 1
0
            public FightPlotUI_FightPlotUIItem GetInstance()
            {
                FightPlotUI_FightPlotUIItem instance = null;

                if (mCachedInstances != null)
                {
                    while ((instance == null || instance.Equals(null)) && mCachedInstances.Count > 0)
                    {
                        instance = mCachedInstances.Dequeue();
                    }
                }
                if (instance == null || instance.Equals(null))
                {
                    instance = Instantiate <FightPlotUI_FightPlotUIItem>(m_FightPlotUIItem);
                }
                Transform t0 = m_FightPlotUIItem.transform;
                Transform t1 = instance.transform;

                t1.SetParent(t0.parent);
                t1.localPosition = t0.localPosition;
                t1.localRotation = t0.localRotation;
                t1.localScale    = t0.localScale;
                t1.SetSiblingIndex(t0.GetSiblingIndex() + 1);
                return(instance);
            }
Esempio n. 2
0
        void ShowFightPlotTips(string text)
        {
            FightPlotUI_FightPlotUIItem plotItem = FightPlotUIItem.GetInstance();

            plotItem.gameObject.SetActive(true);
            plotItem.Plottxt.text.text = text;
            Destroy(plotItem.gameObject, 2.85f);
        }
Esempio n. 3
0
 public bool CacheInstance(FightPlotUI_FightPlotUIItem instance)
 {
     if (instance == null || instance.Equals(null))
     {
         return(false);
     }
     if (mCachedInstances == null)
     {
         mCachedInstances = new Queue <FightPlotUI_FightPlotUIItem>();
     }
     if (mCachedInstances.Contains(instance))
     {
         return(false);
     }
     instance.gameObject.SetActive(false);
     mCachedInstances.Enqueue(instance);
     return(true);
 }
Esempio n. 4
0
        void ShowFightPlotTips(int id)
        {
            //TipsItem tipsItem = Global.gApp.gGameData.TipsData.Get(id);
            //if (tipsItem != null)
            //{
            //    FightPlotUI_FightPlotUIItem plotItem = FightPlotUIItem.GetInstance();
            //    plotItem.gameObject.SetActive(true);
            //    plotItem.Plottxt.text.text = tipsItem.txtcontent;
            //    Destroy(plotItem.gameObject, 2.85f);
            //}
            //else
            //{
            //    Debug.LogError(" ShowFightPlotTips id 错误  " + id);
            //}
            FightPlotUI_FightPlotUIItem plotItem = FightPlotUIItem.GetInstance();

            plotItem.gameObject.SetActive(true);
            plotItem.Plottxt.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(id);
            Destroy(plotItem.gameObject, 2.85f);
        }