/// <summary>
 /// Call to remove an item from this group and destroy it.
 /// </summary>
 /// <param name="item">The item to remove and destroy.</param>
 public void RemoveDebugItem(DebugMenuItem item)
 {
     if (m_MenuItems.Contains(item))
     {
         m_MenuItems.Remove(item);
         Destroy(item.gameObject);
     }
 }
 /// <summary>
 /// Call to add an item to this grou.
 /// </summary>
 /// <param name="item">The item to add.</param>
 public void AddDebugItem(DebugMenuItem item)
 {
     if (item != null)
     {
         item.transform.SetParent(this.transform, false);
         m_MenuItems.Add(item);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Adds a DebugMenu item to the correct group and tracking.
        /// </summary>
        /// <param name="groupName">The group to add to.</param>
        /// <param name="owner">The owner to associate with.</param>
        /// <param name="item">The debug menu item to add.</param>
        /// <returns>The unique id for this item/</returns>
        public int AddItem(string groupName, GameObject owner, DebugMenuItem item)
        {
            DebugItemGroup group = GetItemGroup(groupName, true);

            ItemCommonInfo info = new ItemCommonInfo();

            info.mDebugMenuItem = item;
            info.mGroupName     = groupName;
            info.mOwner         = owner;
            info.mURID          = mCurURID++;

            group.AddDebugItem(item);
            mMenuItems.Add(info);

            return(info.mURID);
        }