void BottomArea()
        {
            // Background
            GUILayout.BeginVertical(ms_Constants.bottomBarBg);

            GUILayout.Space(8);
            GUILayout.BeginHorizontal();
            GUILayout.Space(10);
            if (GUILayout.Button(EditorGUIUtility.TrTextContent("All"), GUILayout.Width(50)))
            {
                m_Tree.SetAllEnabled(PackageImportTreeView.EnabledState.All);
            }

            if (GUILayout.Button(EditorGUIUtility.TrTextContent("None"), GUILayout.Width(50)))
            {
                m_Tree.SetAllEnabled(PackageImportTreeView.EnabledState.None);
            }

            ReInstallToggle();

            GUILayout.FlexibleSpace();
            if (GUILayout.Button(EditorGUIUtility.TrTextContent("Cancel")))
            {
                PackageUtility.ImportPackageAssetsCancelledFromGUI(m_PackageName, m_ImportPackageItems);

                PopupWindowWithoutFocus.Hide();
                Close();
                GUIUtility.ExitGUI();
            }
            if (GUILayout.Button(EditorGUIUtility.TrTextContent("Import")))
            {
                bool doImport = true;
                if (doReInstall)
                {
                    doImport = EditorUtility.DisplayDialog("Re-Install?", "Highlighted folders will be completely deleted first! Recommend backing up your project first. Are you sure?", "Do It", "Cancel");
                }

                if (doImport)
                {
                    if (m_ImportPackageItems != null)
                    {
                        PackageUtility.ImportPackageAssets(m_PackageName, m_ImportPackageItems, doReInstall);
                    }

                    PopupWindowWithoutFocus.Hide();
                    Close();
                    GUIUtility.ExitGUI();
                }
            }

            GUILayout.Space(10);
            GUILayout.EndHorizontal();
            GUILayout.Space(5);
            GUILayout.EndVertical();
        }
Beispiel #2
0
        void BottomArea()
        {
            // Background
            GUILayout.BeginVertical(ms_Constants.bottomBarBg);

            GUILayout.Space(8);
            GUILayout.BeginHorizontal();
            GUILayout.Space(10);
            if (GUILayout.Button(EditorGUIUtility.TrTextContent("All"), GUILayout.Width(50)))
            {
                m_Tree.SetAllEnabled(PackageImportTreeView.EnabledState.All);
            }

            if (GUILayout.Button(EditorGUIUtility.TrTextContent("None"), GUILayout.Width(50)))
            {
                m_Tree.SetAllEnabled(PackageImportTreeView.EnabledState.None);
            }

            GUILayout.FlexibleSpace();
            if (GUILayout.Button(EditorGUIUtility.TrTextContent("Cancel")))
            {
                PackageUtility.ImportPackageAssetsCancelledFromGUI(m_PackageName, m_ImportPackageItems);

                PopupWindowWithoutFocus.Hide();
                Close();
                GUIUtility.ExitGUI();
            }
            if (GUILayout.Button(EditorGUIUtility.TrTextContent("Import")))
            {
                if (m_ImportPackageItems != null)
                {
                    PackageUtility.ImportPackageAssets(m_PackageName, m_ImportPackageItems);
                }

                PopupWindowWithoutFocus.Hide();
                Close();
                GUIUtility.ExitGUI();
            }

            GUILayout.Space(10);
            GUILayout.EndHorizontal();
            GUILayout.Space(5);
            GUILayout.EndVertical();
        }
 public void CancelImport()
 {
     PackageUtility.ImportPackageAssetsCancelledFromGUI(m_PackageName, m_InitialImportItems);
     CloseImportWindow();
 }