예제 #1
0
        public GameObject[] GetObject(int count)
        {
            ObjContainerItem item = null;

            for (int i = 0; i < ItemArray.Length; i++)
            {
                if (ItemArray[i].Count == count)
                {
                    item = ItemArray[i];
                }
            }
            if (null != item)
            {
                return(item.ObjArray);
            }
            return(null);
        }
예제 #2
0
        public T[] GetComponent <T>(int count) where T : Component
        {
            ObjContainerItem item = null;

            for (int i = 0; i < ItemArray.Length; i++)
            {
                if (ItemArray[i].Count == count)
                {
                    item = ItemArray[i];
                }
            }
            if (null == item)
            {
                return(null);
            }
            T[] arr = new T[item.Count];
            for (int i = 0; i < item.Count; i++)
            {
                arr[i] = item.ObjArray[i].GetComponent <T>();
            }
            return(arr);
        }