コード例 #1
0
        static void Button_AssetStore()
        {
            var image =
#if UNITY_2020_1_OR_NEWER
                EditorIcon.package_manager;
#else
                EditorIcon.asset_store;
#endif
            var tooltip =
#if UNITY_2020_1_OR_NEWER
                "Package Manager";
#else
                S._OpenAssetStore;
#endif
            var windowT =
#if UNITY_2020_1_OR_NEWER
                UnityTypes.UnityEditor_PackageManager_UI_PackageManagerWindow;
#else
                UnityTypes.UnityEditor_AssetStoreWindow;
#endif

            if (GUILayout.Button(EditorHelper.TempContent(image, tooltip), s_styles.Button, GUILayout.Width(s_styles.IconButtonSize)))
            {
                EditorWindowUtils.ShowWindow(windowT, EE.IsUtilityWindow(windowT));
            }
        }
コード例 #2
0
        /////////////////////////////////////////
        internal static void ShowWindowButton(Type editorWindowType, string text, Texture2D image)
        {
            if (editorWindowType == null)
            {
                return;
            }
            var _window = EditorWindowUtils.Find(editorWindowType);

            if (_window != null)
            {
                return;
            }

            if (ShowSideButton(text, image))
            {
                var window = EditorWindowUtils.ShowWindow(editorWindowType);
                window.titleContent = new GUIContent(text, window.titleContent.image);
            }
        }