Esempio n. 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 UISpellSlot GetSlot(int ID, UISpellSlot_Group group)
        {
            UISpellSlot[] sl = Resources.FindObjectsOfTypeAll <UISpellSlot>();

            foreach (UISpellSlot 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);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets all the slots in the specified group.
        /// </summary>
        /// <returns>The slots.</returns>
        /// <param name="group">The spell slot group.</param>
        public static List <UISpellSlot> GetSlotsInGroup(UISpellSlot_Group group)
        {
            List <UISpellSlot> slots = new List <UISpellSlot>();

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

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

            return(slots);
        }
Esempio n. 3
0
        /// <summary>
        /// Gets all the slots in the specified group.
        /// </summary>
        /// <returns>The slots.</returns>
        /// <param name="group">The spell slot group.</param>
        public static List <UISpellSlot> GetSlotsInGroup(UISpellSlot_Group group)
        {
            List <UISpellSlot> slots = new List <UISpellSlot>();

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

            foreach (UISpellSlot 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(UISpellSlot a, UISpellSlot b)
            {
                return(a.ID.CompareTo(b.ID));
            });

            return(slots);
        }