Beispiel #1
0
        protected virtual void RecycleObject(UIListItem Obj)
        {
            if (!objectPool.ContainsKey(Obj.sampleIndex))
            {
                objectPool.Add(Obj.sampleIndex, new List <UIListItem>());
            }

            Obj.gameObject.SetActive(false);
            objectPool[Obj.sampleIndex].Add(Obj);
        }
Beispiel #2
0
 protected virtual float GetItemPositionInScene(UIListItem Obj)
 {
     if (null != Obj)
     {
         if (Layout.vertical == layout)
         {
             return(Obj.transform.localPosition.y);
         }
         else
         {
             return(Obj.transform.localPosition.x);
         }
     }
     else
     {
         return(Mathf.Infinity);
     }
 }