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); } } }