Esempio n. 1
0
        private void OnSelectedABDepList(List <IEditorTableItemInfo> infoList)
        {
            var list = infoList.ConvertAll <ABInfo>(info => info as ABInfo);

            ABDatabase.RefreshAssets(list);
            m_AssetTree.UpdateInfoList(null);
        }
Esempio n. 2
0
 private void OnSelectedABList(List <IEditorTableItemInfo> infoList)
 {
     m_SelectedABInfos = infoList.ConvertAll <ABInfo>(info => info as ABInfo);
     ABDatabase.RefreshAssets(m_SelectedABInfos);
     m_AssetTree.UpdateInfoList(null);
     UpdateDepInfoList();
 }
Esempio n. 3
0
        internal void RefreshAB()
        {
            ABDatabase.abSource = abSource;
            var error = ABDatabase.RefreshAB(m_SelectedPlatform);

            if (!string.IsNullOrEmpty(error))
            {
                ShowNotification(new GUIContent(error));
            }
        }
Esempio n. 4
0
 private void UpdateDepInfoList()
 {
     if (m_SelectedDepIndex == 0)
     {
         m_ABDepTree.UpdateInfoList(ABDatabase.GetABDepInfoList(m_SelectedABInfos));
     }
     else
     {
         m_ABDepTree.UpdateInfoList(ABDatabase.GetABRefInfoList(m_SelectedABInfos));
     }
 }
Esempio n. 5
0
 private void Update()
 {
     ABDatabase.Update();
     if (m_ABTree != null)
     {
         if (ABDatabase.IsABDirty())
         {
             m_ABTree.UpdateInfoList(ABDatabase.GetABInfoList(m_SelectedABType));
         }
         if (ABDatabase.IsAssetDirty())
         {
             m_AssetTree.UpdateInfoList(ABDatabase.GetAssetInfoList(m_SelectedAssetType));
         }
     }
 }
Esempio n. 6
0
        private void GUIButton()
        {
            GUILayout.BeginHorizontal();
            if (GUILayout.Button(m_SettingsTexture, GUILayout.Width(k_ABToolbarHeight), GUILayout.Height(k_ABToolbarHeight)))
            {
                GUISettingsPanel();
            }
            var clicked = GUILayout.Button(m_RefreshTexture, GUILayout.Width(k_ABToolbarHeight), GUILayout.Height(k_ABToolbarHeight));

            if (clicked)
            {
                RefreshAB();
            }
            var platform = GUILayout.SelectionGrid(m_SelectedPlatformIndex, m_PlatformTextures, 3,
                                                   GUILayout.Width(k_ABToolbarHeight * 3.3f), GUILayout.Height(k_ABToolbarHeight));

            if (platform != m_SelectedPlatformIndex)
            {
                m_SelectedPlatformIndex = platform;
                switch (m_SelectedPlatformIndex)
                {
                case 0: m_SelectedPlatform = BuildTarget.StandaloneWindows64; break;

                case 1: m_SelectedPlatform = BuildTarget.iOS; break;

                case 2: m_SelectedPlatform = BuildTarget.Android; break;
                }
                RefreshAB();
            }
            var tabLabels = new string[] {
                "All\n" + ABDatabase.GetABTypeSizeStr(ABType.All),
                "Model\n" + ABDatabase.GetABTypeSizeStr(ABType.Model),
                "Scene\n" + ABDatabase.GetABTypeSizeStr(ABType.Scene),
                "UI\n" + ABDatabase.GetABTypeSizeStr(ABType.UI),
                "Other\n" + ABDatabase.GetABTypeSizeStr(ABType.Other),
                "Dep\n" + ABDatabase.GetABTypeSizeStr(ABType.Dep)
            };
            var barWidth = position.width - 5 * k_ABToolbarHeight + 7.4f;
            var selected = (ABType)GUILayout.Toolbar((int)m_SelectedABType, tabLabels, GUILayout.Height(k_ABToolbarHeight),
                                                     GUILayout.Width(barWidth));

            if (selected != m_SelectedABType)
            {
                m_SelectedABType = selected;
                m_ABTree.UpdateInfoList(ABDatabase.GetABInfoList(m_SelectedABType));
            }
            GUILayout.EndHorizontal();
        }
Esempio n. 7
0
        private void GUISearchAndAsset()
        {
            var searchHeight = 16.8f;
            var btnWidth     = 98;

            m_SelectedSearchIndex = GUILayout.SelectionGrid(m_SelectedSearchIndex, Styles.searchBtns, 2,
                                                            GUILayout.Width(btnWidth), GUILayout.Height(searchHeight - 2));
            var rect = new Rect(m_Panel.LeftTopRect.x + btnWidth + 1, m_Panel.LeftTopRect.y - searchHeight - 2f,
                                m_Panel.LeftTopRect.width - btnWidth + m_Panel.SplitterWidth, searchHeight);

            if (m_SelectedSearchIndex == 0)
            {
                var newSearch = m_SearchField.OnGUI(rect, ABDatabase.abSearchString);
                if (ABDatabase.abSearchString != newSearch)
                {
                    ABDatabase.abSearchString = newSearch;
                    m_ABTree.UpdateInfoList(ABDatabase.GetABInfoList(m_SelectedABType));
                    Repaint();
                }
            }
            else
            {
                var newSearch = m_SearchField.OnGUI(rect, ABDatabase.assetsSearchString);
                if (ABDatabase.assetsSearchString != newSearch)
                {
                    ABDatabase.assetsSearchString = newSearch;
                    m_AssetTree.UpdateInfoList(ABDatabase.GetAssetInfoList(m_SelectedAssetType));
                    Repaint();
                }
            }
            var tabLabels = new string[] {
                "All\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.None),
                "Material\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.Material),
                "Texture\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.Texture),
                "Prefab\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.Prefab),
                "Shader\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.Shader),
                "Asset\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.Asset),
                "Other\n" + ABDatabase.GetAssetTypeSizeStr(AssetsType.Other),
            };
            var barWidth = m_Panel.RightTopRect.width;
            var barRect  = new Rect(m_Panel.RightTopRect.x, m_Panel.RightTopRect.y - k_AssetsToolbarHeight,
                                    m_Panel.RightTopRect.width, k_AssetsToolbarHeight - 0.5f);
            var selected = (AssetsType)GUI.Toolbar(barRect, (int)m_SelectedAssetType, tabLabels);

            if (selected != m_SelectedAssetType)
            {
                m_SelectedAssetType = selected;
                m_AssetTree.UpdateInfoList(ABDatabase.GetAssetInfoList(m_SelectedAssetType));
            }

            barWidth = m_Panel.LeftBottomRect.width;
            barRect  = new Rect(m_Panel.LeftBottomRect.x, m_Panel.LeftBottomRect.y - k_DepToolbarHeight,
                                m_Panel.LeftBottomRect.width, k_DepToolbarHeight - 0.5f);
            var selectedDep = GUI.Toolbar(barRect, m_SelectedDepIndex, new string[] { "Dep", "Ref" });

            if (selectedDep != m_SelectedDepIndex)
            {
                m_SelectedDepIndex = selectedDep;
                UpdateDepInfoList();
            }
        }