예제 #1
0
        private void loadProductInfo()
        {
            List <ProductInfo> baseProducts = new List <ProductInfo>()
            {
                new CinemaDirectorBaseProductInfo(), new CinemaProCamsBaseProductInfo(),
                new CinemaThemesBaseProductInfo(), new CinemaMocapBaseProductInfo()
            };

            availableProducts = new List <ProductInfo>();
            installedProducts = new List <ProductInfo>();

            foreach (var productInfo in baseProducts)
            {
                Type[] installedProductTypes = GetAllSubTypes(productInfo.GetType());
                if (installedProductTypes.Length > 0)
                {
                    foreach (Type productType in installedProductTypes)
                    {
                        ProductInfo installedProduct = Activator.CreateInstance(productType) as ProductInfo;
                        installedProduct.Initialize(Repaint);
                        installedProducts.Add(installedProduct);
                    }
                }
                else
                {
                    ProductInfo product = Activator.CreateInstance(productInfo.GetType()) as ProductInfo;
                    product.Initialize(Repaint);
                    availableProducts.Add(product);
                }
            }
        }
예제 #2
0
        private void loadProductInfo()
        {
            for (int i = 0; i < availableProductNames.Count; i++)
            {
                string baseFilename      = "BaseProductInfo";
                string installedFilename = string.Concat(availableProductNames[i], "InstalledProductInfo");
                string path = IsInstalled(installedFilename);

                if (path != null)
                {
                    ProductInfo installedProduct = ParseXml(XDocument.Load(path))[0];
                    installedProduct.Initialize(Repaint);
                    installedProducts.Add(installedProduct);
                }
                else
                {
                    ProductInfo availableProduct = ParseXml(XDocument.Parse(((TextAsset)Resources.Load(baseFilename)).text))[i];
                    availableProduct.Initialize(Repaint);
                    availableProducts.Add(availableProduct);
                }
            }
        }
        private void drawProduct(ProductInfo product)
        {
            EditorGUILayout.BeginVertical(skin.FindStyle("Header"));
            Rect foldoutRect = EditorGUILayout.GetControlRect();
            product.ShowProductInfo.target = EditorGUI.Foldout(foldoutRect, product.ShowProductInfo.target, product.name, true);
            EditorGUILayout.EndVertical();

#if UNITY_5
            using (var productGroup = new EditorGUILayout.FadeGroupScope(product.ShowProductInfo.faded))
            {
                if (productGroup.visible)
                {
#else
            {
                if(product.ShowProductInfo.target)
                {
#endif
            
                    Rect contentRect = EditorGUILayout.BeginVertical(skin.FindStyle("Content"));
                    product.OnGUI(contentRect);
                    EditorGUILayout.EndVertical();
                }
            }
        }

        private void loadProductInfo()
        {
            List<ProductInfo> baseProducts = new List<ProductInfo>()
             {
                 new CinemaDirectorBaseProductInfo(), new CinemaProCamsBaseProductInfo(), 
                 new CinemaThemesBaseProductInfo(), new CinemaMocapBaseProductInfo()
             };

            availableProducts = new List<ProductInfo>();
            installedProducts = new List<ProductInfo>();

            foreach (var productInfo in baseProducts)
            {
                Type[] installedProductTypes = GetAllSubTypes(productInfo.GetType());
                if (installedProductTypes.Length > 0)
                {
                    foreach (Type productType in installedProductTypes)
                    {
                        ProductInfo installedProduct = Activator.CreateInstance(productType) as ProductInfo;
                        installedProduct.Initialize(Repaint);
                        installedProducts.Add(installedProduct);
                    }
                }
                else
                {
                    ProductInfo product = Activator.CreateInstance(productInfo.GetType()) as ProductInfo;
                    product.Initialize(Repaint);
                    availableProducts.Add(product);
                }
            }
        }