Inheritance: EditorWindow
Example #1
0
        private static void ShowExportPackage()
        {
            PackageExport window = EditorWindow.GetWindow <PackageExport>(true, "Exporting package");

            window.BuildAssetList();
            window.Repaint();
        }
Example #2
0
 private void BuildAssetList()
 {
     this.UnscheduleBuildAssetList();
     this.m_ExportPackageItems = PackageExport.GetAssetItemsForExport(Selection.assetGUIDsDeepSelection, this.m_IncludeDependencies).ToArray <ExportPackageItem>();
     this.m_Tree          = null;
     this.m_TreeViewState = null;
     base.Repaint();
 }
Example #3
0
 public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
 {
     this.m_PackageExport = packageExport;
     this.m_TreeView      = new TreeView((EditorWindow)this.m_PackageExport, treeViewState);
     PackageExportTreeView.PackageExportTreeViewDataSource treeViewDataSource = new PackageExportTreeView.PackageExportTreeViewDataSource(this.m_TreeView, this);
     PackageExportTreeView.PackageExportTreeViewGUI        exportTreeViewGui  = new PackageExportTreeView.PackageExportTreeViewGUI(this.m_TreeView, this);
     this.m_TreeView.Init(startRect, (ITreeViewDataSource)treeViewDataSource, (ITreeViewGUI)exportTreeViewGui, (ITreeViewDragging)null);
     this.m_TreeView.ReloadData();
     this.m_TreeView.selectionChangedCallback += new System.Action <int[]>(this.SelectionChanged);
     exportTreeViewGui.itemWasToggled         += new System.Action <PackageExportTreeView.PackageExportTreeViewItem>(this.ItemWasToggled);
     this.ComputeEnabledStateForFolders();
 }
 public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
 {
     this.m_PackageExport = packageExport;
     this.m_TreeView = new TreeViewController(this.m_PackageExport, treeViewState);
     PackageExportTreeViewDataSource data = new PackageExportTreeViewDataSource(this.m_TreeView, this);
     PackageExportTreeViewGUI gui = new PackageExportTreeViewGUI(this.m_TreeView, this);
     this.m_TreeView.Init(startRect, data, gui, null);
     this.m_TreeView.ReloadData();
     this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.SelectionChanged));
     gui.itemWasToggled = (Action<PackageExportTreeViewItem>) Delegate.Combine(gui.itemWasToggled, new Action<PackageExportTreeViewItem>(this.ItemWasToggled));
     this.ComputeEnabledStateForFolders();
 }
 public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
 {
   this.m_PackageExport = packageExport;
   this.m_TreeView = new TreeView((EditorWindow) this.m_PackageExport, treeViewState);
   PackageExportTreeView.PackageExportTreeViewDataSource treeViewDataSource = new PackageExportTreeView.PackageExportTreeViewDataSource(this.m_TreeView, this);
   PackageExportTreeView.PackageExportTreeViewGUI exportTreeViewGui = new PackageExportTreeView.PackageExportTreeViewGUI(this.m_TreeView, this);
   this.m_TreeView.Init(startRect, (ITreeViewDataSource) treeViewDataSource, (ITreeViewGUI) exportTreeViewGui, (ITreeViewDragging) null);
   this.m_TreeView.ReloadData();
   this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.SelectionChanged);
   exportTreeViewGui.itemWasToggled += new System.Action<PackageExportTreeView.PackageExportTreeViewItem>(this.ItemWasToggled);
   this.ComputeEnabledStateForFolders();
 }
        public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
        {
            this.m_PackageExport = packageExport;
            this.m_TreeView      = new TreeViewController(this.m_PackageExport, treeViewState);
            PackageExportTreeViewDataSource data = new PackageExportTreeViewDataSource(this.m_TreeView, this);
            PackageExportTreeViewGUI        gui  = new PackageExportTreeViewGUI(this.m_TreeView, this);

            this.m_TreeView.Init(startRect, data, gui, null);
            this.m_TreeView.ReloadData();
            this.m_TreeView.selectionChangedCallback = (Action <int[]>)Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action <int[]>(this.SelectionChanged));
            gui.itemWasToggled = (Action <PackageExportTreeViewItem>)Delegate.Combine(gui.itemWasToggled, new Action <PackageExportTreeViewItem>(this.ItemWasToggled));
            this.ComputeEnabledStateForFolders();
        }
        public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
        {
            m_PackageExport = packageExport;

            m_TreeView = new TreeViewController(m_PackageExport, treeViewState);
            var dataSource = new PackageExportTreeViewDataSource(m_TreeView, this);
            var gui        = new PackageExportTreeViewGUI(m_TreeView, this);

            m_TreeView.Init(startRect, dataSource, gui, null);
            m_TreeView.ReloadData();
            m_TreeView.selectionChangedCallback += SelectionChanged;
            gui.itemWasToggled += ItemWasToggled;

            ComputeEnabledStateForFolders();
        }
        public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
        {
            this.m_PackageExport = packageExport;
            this.m_TreeView      = new TreeView(this.m_PackageExport, treeViewState);
            PackageExportTreeView.PackageExportTreeViewDataSource data = new PackageExportTreeView.PackageExportTreeViewDataSource(this.m_TreeView, this);
            PackageExportTreeView.PackageExportTreeViewGUI        packageExportTreeViewGUI = new PackageExportTreeView.PackageExportTreeViewGUI(this.m_TreeView, this);
            this.m_TreeView.Init(startRect, data, packageExportTreeViewGUI, null);
            this.m_TreeView.ReloadData();
            TreeView expr_64 = this.m_TreeView;

            expr_64.selectionChangedCallback = (Action <int[]>)Delegate.Combine(expr_64.selectionChangedCallback, new Action <int[]>(this.SelectionChanged));
            PackageExportTreeView.PackageExportTreeViewGUI expr_86 = packageExportTreeViewGUI;
            expr_86.itemWasToggled = (Action <PackageExportTreeView.PackageExportTreeViewItem>)Delegate.Combine(expr_86.itemWasToggled, new Action <PackageExportTreeView.PackageExportTreeViewItem>(this.ItemWasToggled));
            this.ComputeEnabledStateForFolders();
        }
 private void BuildAssetList()
 {
     this.m_ExportPackageItems = PackageExport.GetAssetItemsForExport((ICollection <string>)Selection.assetGUIDsDeepSelection, this.m_IncludeDependencies).ToArray <ExportPackageItem>();
     this.m_Tree          = (PackageExportTreeView)null;
     this.m_TreeViewState = (TreeViewState)null;
 }
Example #10
0
 public void OnGUI()
 {
     if (PackageExport.ms_Constants == null)
     {
         PackageExport.ms_Constants = new PackageExport.Constants();
     }
     if (this.m_assets == null)
     {
         return;
     }
     if (this.m_LeastIndent == 999999)
     {
         int num = this.m_LeastIndent;
         for (int i = 0; i < this.m_assets.Length; i++)
         {
             int num2 = PackageExport.CountOccurencesOfChar(this.m_assets[i].pathName, '/');
             if (num > num2)
             {
                 num = num2;
             }
         }
         this.m_LeastIndent = num - 1;
     }
     if (this.m_assets != null)
     {
         this.SetupListView();
         bool flag = Event.current.type == EventType.Repaint;
         GUILayout.BeginVertical(new GUILayoutOption[0]);
         GUILayout.Label("Items to Export", PackageExport.ms_Constants.title, new GUILayoutOption[0]);
         GUILayout.Space(1f);
         EditorGUIUtility.SetIconSize(new Vector2(16f, 16f));
         foreach (ListViewElement listViewElement in ListViewGUI.ListView(this.m_ListView, GUIStyle.none, new GUILayoutOption[0]))
         {
             AssetsItem assetsItem = this.m_assets[listViewElement.row];
             Rect       position   = listViewElement.position;
             position = new Rect(position.x + 1f, position.y, position.width - 2f, position.height);
             int num3 = PackageExport.CountOccurencesOfChar(assetsItem.pathName, '/') - this.m_LeastIndent;
             if (flag && this.m_ListView.row == listViewElement.row)
             {
                 PackageExport.ms_Constants.ConsoleEntryBackEven.Draw(position, false, false, true, false);
             }
             float y = listViewElement.position.y;
             position.x += 3f;
             int enabled = assetsItem.enabled;
             assetsItem.enabled = ((!GUI.Toggle(new Rect(position.x, position.y, 16f, 16f), assetsItem.enabled != 0, string.Empty)) ? 0 : 1);
             if (enabled != assetsItem.enabled)
             {
                 this.m_ListView.row        = listViewElement.row;
                 GUIUtility.keyboardControl = this.m_ListView.ID;
                 this.CheckChildren(assetsItem);
             }
             if (flag)
             {
                 Rect    position2  = new Rect(position.x + (float)(15 * num3), y + 1f, 16f, 16f);
                 Texture cachedIcon = AssetDatabase.GetCachedIcon(assetsItem.pathName);
                 if (cachedIcon != null)
                 {
                     GUI.DrawTexture(position2, cachedIcon);
                 }
             }
             position = new Rect(position.x + 20f + (float)(15 * num3), listViewElement.position.y, position.width - (float)(20 + 15 * num3), position.height);
             GUI.Label(position, assetsItem.pathName);
         }
         this.FrameLastGUIRect();
         GUILayout.EndVertical();
         if (this.m_ListView.row != -1 && GUIUtility.keyboardControl == this.m_ListView.ID && Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Space)
         {
             this.m_assets[this.m_ListView.row].enabled = ((this.m_assets[this.m_ListView.row].enabled != 0) ? 0 : 1);
             this.CheckChildren(this.m_assets[this.m_ListView.row]);
             Event.current.Use();
         }
         EditorGUIUtility.SetIconSize(Vector2.zero);
         GUILayout.Space(5f);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         GUILayout.Space(10f);
         if (GUILayout.Button(EditorGUIUtility.TextContent("All"), new GUILayoutOption[]
         {
             GUILayout.Width(50f)
         }))
         {
             for (int j = 0; j < this.m_assets.Length; j++)
             {
                 this.m_assets[j].enabled = 1;
             }
         }
         if (GUILayout.Button(EditorGUIUtility.TextContent("None"), new GUILayoutOption[]
         {
             GUILayout.Width(50f)
         }))
         {
             for (int k = 0; k < this.m_assets.Length; k++)
             {
                 this.m_assets[k].enabled = 0;
             }
         }
         GUILayout.Space(10f);
         bool flag2 = GUILayout.Toggle(this.m_bIncludeDependencies, "Include dependencies", new GUILayoutOption[0]);
         if (flag2 != this.m_bIncludeDependencies)
         {
             this.m_bIncludeDependencies = flag2;
             this.BuildAssetList();
         }
         GUILayout.FlexibleSpace();
         if (GUILayout.Button(EditorGUIUtility.TextContent("Export..."), new GUILayoutOption[0]))
         {
             this.Export();
             GUIUtility.ExitGUI();
         }
         GUILayout.Space(10f);
         GUILayout.EndHorizontal();
         GUILayout.Space(10f);
     }
 }
Example #11
0
 private void BuildAssetList()
 {
     this.m_assets = PackageExport.GetAssetItemsForExport(Selection.assetGUIDsDeepSelection, this.m_bIncludeDependencies).ToArray <AssetsItem>();
 }