예제 #1
0
        internal override void OnHeaderControlsGUI()
        {
            base.OnHeaderControlsGUI();

            // We want to have this button enabled even for immutable package
            var previousEnabled = GUI.enabled;

            GUI.enabled = packageState != null && packageState.isValidFile && targets.Length == 1;
            if (GUILayout.Button(Styles.viewInPackageManager, EditorStyles.miniButton))
            {
                PackageManagerWindow.SelectPackageAndFilterStatic(packageState.info.packageName.completeName);
            }
            GUI.enabled = previousEnabled;
        }
        internal override void OnHeaderControlsGUI()
        {
            base.OnHeaderControlsGUI();

            var previousEnabled = GUI.enabled;

            GUI.enabled = targets.Length == 1 && m_Package?.state == PackageState.InDevelopment && (m_Version?.isInstalled ?? false);
            if (GUILayout.Button(Styles.editPackage, EditorStyles.miniButton))
            {
                var path     = m_Version.packageInfo.assetPath;
                var manifest = AssetDatabase.LoadAssetAtPath <PackageManifest>($"{path}/package.json");
                if (manifest != null)
                {
                    m_Selection.activeObject = manifest;
                }
            }
            GUI.enabled = targets.Length == 1 && m_Package != null && m_Version != null;
            if (GUILayout.Button(Styles.viewInPackageManager, EditorStyles.miniButton))
            {
                PackageManagerWindow.SelectPackageAndFilterStatic(m_Package.Is(PackageType.AssetStore) ? m_Version.packageUniqueId : m_Version.uniqueId);
            }
            GUI.enabled = previousEnabled;
        }