示例#1
0
        void OnContentProductChanged(ContentProduct target)
        {
            m_ActiveProduct = target;
            m_Categories.Clear();

            if (m_ActiveProduct != null)
            {
                m_Categories.Add(CategoryFilter.AllEntries);
                m_Categories.AddRange(target.Categories);
            }

            m_Drawer.SetCategoryList(m_Categories);
        }
示例#2
0
        /// <summary>
        /// Opens the Content Manager window or focuses it on a specific Content Product.
        /// </summary>
        /// <param name="startingProduct">The product to start the Content Manager focused on</param>
        public static void OpenWithWithProduct(ContentProduct startingProduct)
        {
            var win = GetWindow <ContentManagerWindow>();

            win.titleContent = new GUIContent(k_ContentManagerWindowName);

            if (startingProduct != null)
            {
                if (win.m_ContentManagerDriver != null)
                {
                    win.OnContentProductChanged(startingProduct);
                }
                else
                {
                    win.m_ActiveProduct = startingProduct;
                }
            }
        }
示例#3
0
        void UpdateFilteredProducts()
        {
            var visibleProducts = ContentManagerDriver.AvailableContentProducts.Where(product => product.Visible);

            if (m_ActiveProduct == null)
            {
                m_ActiveProduct = visibleProducts.FirstOrDefault();

                if (m_ActiveProduct == null)
                {
                    m_ActiveProduct = ContentManagerDriver.AvailableContentProducts.FirstOrDefault();
                }

                if (m_ActiveProduct != null)
                {
                    m_Drawer.SetProduct(m_ActiveProduct);
                }
            }

            m_Products.Clear();
            m_Products.AddRange(visibleProducts);
            m_Drawer.SetProductList(m_Products);
        }
 public ProductDropdownItem(string name, ContentProduct product) : base(name)
 {
     Product = product;
 }