Beispiel #1
0
		/// <summary>
		/// Gets the slot with the specified ID and Group.
		/// </summary>
		/// <returns>The slot.</returns>
		/// <param name="ID">The slot ID.</param>
		/// <param name="group">The slot Group.</param>
		public static UIItemSlot GetSlot(int ID, UIItemSlot_Group group)
		{
			UIItemSlot[] sl = Resources.FindObjectsOfTypeAll<UIItemSlot>();
			
			foreach (UIItemSlot s in sl)
			{
				// Check if the slow is active in the hierarchy
				if (s.gameObject.activeInHierarchy && s.ID == ID && s.slotGroup == group)
					return s;
			}
			
			return null;
		}
Beispiel #2
0
		/// <summary>
		/// Gets all the item slots in the specified group.
		/// </summary>
		/// <returns>The slots.</returns>
		/// <param name="group">The item slot group.</param>
		public static List<UIItemSlot> GetSlotsInGroup(UIItemSlot_Group group)
		{
			List<UIItemSlot> slots = new List<UIItemSlot>();
			UIItemSlot[] sl = Resources.FindObjectsOfTypeAll<UIItemSlot>();
			
			foreach (UIItemSlot s in sl)
			{
				// Check if the slow is active in the hierarchy
				if (s.gameObject.activeInHierarchy && s.slotGroup == group)
					slots.Add(s);
			}
			
			return slots;
		}
Beispiel #3
0
        /// <summary>
        /// Gets all the item slots in the specified group.
        /// </summary>
        /// <returns>The slots.</returns>
        /// <param name="group">The item slot group.</param>
        public static List <UIItemSlot> GetSlotsInGroup(UIItemSlot_Group group)
        {
            List <UIItemSlot> slots = new List <UIItemSlot>();

            UIItemSlot[] sl = Resources.FindObjectsOfTypeAll <UIItemSlot>();

            foreach (UIItemSlot s in sl)
            {
                // Check if the slow is active in the hierarchy
                if (s.gameObject.activeInHierarchy && s.slotGroup == group)
                {
                    slots.Add(s);
                }
            }

            // Sort the slots by id
            slots.Sort(delegate(UIItemSlot a, UIItemSlot b)
            {
                return(a.ID.CompareTo(b.ID));
            });

            return(slots);
        }