Пример #1
0
            public WeaponRaiseUI_WeaponItemUI GetInstance()
            {
                WeaponRaiseUI_WeaponItemUI 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 <WeaponRaiseUI_WeaponItemUI>(m_WeaponItemUI);
                }
                Transform t0 = m_WeaponItemUI.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);
            }
Пример #2
0
 public override void Init <T>(string name, UIInfo info, T arg)
 {
     m_WeaponUI_WeaponItemUI = arg as WeaponRaiseUI_WeaponItemUI;
     m_Item = m_WeaponUI_WeaponItemUI.GetItemConfig();
     base.Init(name, info, arg);
     base.ChangeLanguage();
 }
Пример #3
0
 //刷新ShowScrollItem
 private void ShowScrollItem(int itemType, int showOrder)
 {
     ClearShowList();
     if (!Global.gApp.gGameData.ItemTypeMapData.ContainsKey(itemType))
     {
         return;
     }
     m_WeaponRaiseUi.WeaponItemUI.gameObject.SetActive(false);
     foreach (WeaponItemContainer itemConfigContainer in m_SortWeaponList)
     {
         WeaponRaiseUI_WeaponItemUI itemUI = m_WeaponRaiseUi.WeaponItemUI.GetInstance();
         itemUI.Init(itemConfigContainer.GetItemItem(), showOrder, this);
         m_ShowItemList.Add(itemUI);
     }
 }
Пример #4
0
 public bool CacheInstance(WeaponRaiseUI_WeaponItemUI instance)
 {
     if (instance == null || instance.Equals(null))
     {
         return(false);
     }
     if (mCachedInstances == null)
     {
         mCachedInstances = new Queue <WeaponRaiseUI_WeaponItemUI>();
     }
     if (mCachedInstances.Contains(instance))
     {
         return(false);
     }
     instance.gameObject.SetActive(false);
     mCachedInstances.Enqueue(instance);
     return(true);
 }