Ejemplo n.º 1
0
        /////////////////////////////////////////
        void DrawLeftPane()
        {
            HGUIToolbar.Begin();
            if (HGUIToolbar.Button(EditorIcon.toolbar_plus))
            {
                _add();
            }
            if (HGUIToolbar.Button(EditorIcon.toolbar_minus))
            {
                _minus();
            }
            GUILayout.FlexibleSpace();
            HGUIToolbar.End();

            m_treeViewL?.DrawLayoutGUI();

            void _add()
            {
                m_platform.AddParams($"New ({m_platform.parameters.Count})");
                P.i.selectParamsIndex = m_platform.parameters.Count - 1;
                P.Save();
                m_treeViewL.RegisterFiles();
            }

            void _minus()
            {
                m_platform.parameters.RemoveAt(m_treeViewL.currentItem.index);
                P.Save();
                Utils.SelectItemUpdate();
                m_treeViewL.RegisterFiles();
            }
        }
Ejemplo n.º 2
0
        /////////////////////////////////////////
        void DrawLeftPane()
        {
            HGUIToolbar.Begin();
            if (HGUIToolbar.Button(EditorIcon.toolbar_plus))
            {
                _add();
            }
            if (HGUIToolbar.Button(EditorIcon.toolbar_minus))
            {
                _minus();
            }
            GUILayout.FlexibleSpace();
            HGUIToolbar.End();

            m_treeView.DrawLayoutGUI();

            void _add()
            {
                PB.i.profileList.Add(new PB.Profile($"BuildScene ({PB.i.profileList.Count})"));
                PB.Save();
                m_treeView.RegisterFiles();
            }

            void _minus()
            {
                PB.i.profileList.Remove(m_treeView.currentItem.profile);
                PB.Save();

                m_treeView.RegisterFiles();
            }
        }
Ejemplo n.º 3
0
        /////////////////////////////////////////
        void OnPlayButton(P.Params currentParams)
        {
            switch (currentParams.buildTarget)
            {
            case BuildTarget.StandaloneWindows:
            case BuildTarget.StandaloneWindows64:
                ScopeDisable.Begin(!B.currentOutputPackageFullName.IsExistsFile());
                if (HGUIToolbar.Button(EditorIcon.playbutton))
                {
                    System.Diagnostics.Process.Start(B.currentOutputPackageFullName);
                }
                ScopeDisable.End();
                break;

            case BuildTarget.WebGL: {
                var path = $"{B.currentOutputPackageFullName}/index.html";
                ScopeDisable.Begin(!path.IsExistsFile());
                if (HGUIToolbar.Button(EditorIcon.playbutton))
                {
                    UnityEditorPostprocessBuildPlayer.Launch(BuildTargetGroup.WebGL, BuildTarget.WebGL, path.DirectoryName(), "", BuildOptions.None, null);
                }
                ScopeDisable.End();
                break;
            }

            default:
                ScopeDisable.Begin(true);
                HGUIToolbar.Button(EditorIcon.playbutton, "Not supported.");
                ScopeDisable.End();
                break;
            }
        }
Ejemplo n.º 4
0
        public override void OnDefaultGUI()
        {
            if (singleton.instance.reload)
            {
                singleton.treeViewAsmdef.RegisterAll();
                singleton.treeViewAsmdef.Show(m_selectIndex);
                singleton.instance.reload = false;
            }
            if (singleton.instance.reloadNodeClick)
            {
                singleton.treeViewAsmdef.Show(m_selectIndex);
                singleton.instance.reload = false;
            }

            HGUIToolbar.Begin();
            if (HGUIToolbar.Toggle(m_selectIndex == 0, "All"))
            {
                m_selectIndex = 0;
            }
            if (HGUIToolbar.Toggle(m_selectIndex == 1, "Ref By"))
            {
                m_selectIndex = 1;
            }
            if (HGUIToolbar.Toggle(m_selectIndex == 2, "Ref To"))
            {
                m_selectIndex = 2;
            }
            HGUIToolbar.End();

            singleton.treeViewAsmdef.DrawLayoutGUI();
        }
        public static void DrawGUI()
        {
            E.Load();
            Helper.New(ref m_treeView_AutoSymbols);

            ScopeIsCompile.Begin();

            HGUIToolbar.Begin();
            if (HGUIToolbar.Button(EditorIcon.toolbar_plus))
            {
                _add();
            }
            ScopeDisable.Begin(!m_treeView_AutoSymbols.HasSelection());
            if (HGUIToolbar.Button(EditorIcon.toolbar_minus))
            {
                _remove();
            }
            ScopeDisable.End();

            GUILayout.Space(4);

            ScopeChange.Begin();
            var _b = HEditorGUILayout.ToggleLeft(S._AutomaticsettingatInitializeOnLoad, E.i.m_autoSetDidReloadScripts);

            if (ScopeChange.End())
            {
                E.i.m_autoSetDidReloadScripts = _b;
                E.Save();
            }
            GUILayout.FlexibleSpace();

            if (!Utils.changeSetting)
            {
                if (HGUIToolbar.Button(SS._Apply))
                {
                    Utils.ApplySymbols();
                }
            }
            else
            {
                if (HGUIToolbar.Button(EditorHelper.TempContent(SS._Apply, EditorIcon.warning)))
                {
                    Utils.ApplySymbols();
                }
            }
            HGUIToolbar.End();

            /////////////
            ///
            using (new GUILayoutScope(1, 0)) {
                m_treeView_AutoSymbols.DrawLayoutGUI();
            }

            ScopeIsCompile.End();
        }
Ejemplo n.º 6
0
 /////////////////////////////////////////
 void DrawLeftPane()
 {
     ScopeHorizontal.Begin(EditorStyles.toolbar);
     EditorGUILayout.LabelField("manifest.json");
     GUILayout.FlexibleSpace();
     if (HGUIToolbar.Button(EditorHelper.TempContent(SS._Apply)))
     {
         Utils.ApplyModifyList();
         ManifestJsonUtils.Save();
     }
     ScopeHorizontal.End();
     m_treeViewL.DrawLayoutGUI();
 }
Ejemplo n.º 7
0
        /////////////////////////////////////////
        void DrawRightPane()
        {
            HGUIToolbar.Begin();
            if (HGUIToolbar.Button(EditorIcon.settings))
            {
                UnityEditorMenu.File_Build_Settings();
            }
            //if( HGUIToolbar.Button( EditorIcon.search_icon ) ) ProjectBrowserUtils.SetSearch( "t:Scene" );
            GUILayout.FlexibleSpace();
            HGUIToolbar.End();

            m_treeView.DrawItem();
        }
        public static void DrawGUI()
        {
            E.Load();
            Helper.New(ref Utils.m_treeView_EditorSymbols);

            ScopeIsCompile.Begin();

            HGUIToolbar.Begin();


            ScopeDisable.Begin(Utils.activeSymbol); if (HGUIToolbar.Button(EditorIcon.toolbar_plus))
            {
                _add();
            }
            ScopeDisable.Begin(!Utils.m_treeView_EditorSymbols.HasSelection());
            if (HGUIToolbar.Button(EditorIcon.toolbar_minus))
            {
                _remove();
            }
            ScopeDisable.End();


            GUILayout.FlexibleSpace();

            if (!Utils.activeSymbol)
            {
                ScopeDisable.Begin(!Utils.changeEditorSymbols);
                if (!Utils.changeEditorSymbols)
                {
                    HGUIToolbar.Button(SS._Apply);
                }
                else
                {
                    if (HGUIToolbar.Button(EditorHelper.TempContent(SS._Apply, EditorIcon.warning)))
                    {
                        _set();
                    }
                }
                ScopeDisable.End();
            }


            HGUIToolbar.End();

            /////////////////
            using (new GUILayoutScope(1, 0)) {
                Utils.m_treeView_EditorSymbols.DrawLayoutGUI();
            }
            ScopeIsCompile.End();
        }
Ejemplo n.º 9
0
        /////////////////////////////////////////
        void DrawToolBar()
        {
            HGUIToolbar.Begin();
            if (HGUIToolbar.Button(EditorHelper.TempContent(EditorIcon.settings)))
            {
                SharedModule.SettingsWindow.OpenEditor(Package.nameNicify);
            }

            if (HGUIToolbar.Button(EditorHelper.TempContent(EditorIcon.refresh)))
            {
                Refresh();
            }

            GUILayout.FlexibleSpace();
            HGUIToolbar.End();
        }
Ejemplo n.º 10
0
        /////////////////////////////////////////
        void DrawRightPane()
        {
            HGUIToolbar.Begin();
            if (HGUIToolbar.Toggle(m_installType == InstallType.通常, S._Installablepackages))
            {
                m_installType = InstallType.通常;
                m_treeViewR.RegisterFiles(m_installType);
            }
            if (HGUIToolbar.Toggle(m_installType == InstallType.データベースに直インストール, S._Unitypackage))
            {
                m_installType = InstallType.データベースに直インストール;
                m_treeViewR.RegisterFiles(m_installType);
            }
            HGUIToolbar.End();

            GUILayout.Box("", HEditorStyles.treeViweArea, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));

            var dropRc = GUILayoutUtility.GetLastRect();

            m_treeViewR.OnGUI(dropRc.AlignR(dropRc.width - 1));
        }
Ejemplo n.º 11
0
        /////////////////////////////////////////
        void DrawRightPane()
        {
            var currentParams = P.GetCurrentParams();

            //////////////////

            HGUIToolbar.Begin();
            GUILayout.Label(EditorHelper.TempContent($"{PlayerSettings.productName}",
                                                     $"{S._CompanyName}\t{PlayerSettings.companyName}\n{S._ProductName}\t{PlayerSettings.productName}\n{S._Version}\t{PlayerSettings.bundleVersion}"), EditorStyles.toolbarButton);
            GUILayout.FlexibleSpace();

            ScopeDisable.Begin(!currentParams.development);
            E.connectProfiler.Value = HEditorGUILayout.SessionToggleLeft(S._ConnectProfiler, S._ProfilingisonlyenabledinaDevelopmentPlayer, E.connectProfiler.Value);
            ScopeDisable.End();

            E.autoRunPlayer.Value = HEditorGUILayout.SessionToggleLeft(S._AutoRunPlayer, E.autoRunPlayer.Value);

            if (UnityEditorEditorUserBuildSettings.activeBuildTargetGroup != P.i.selectBuildTargetGroup)
            {
                HGUIToolbar.DropDown2(S._SwitchPlatform, EditorIcon.warning
                                      , OnSwitchPlatform
                                      , OnDropAction);
            }
            else
            {
                HGUIToolbar.DropDown2(E.autoRunPlayer.Value ? S._BuildAndRun : S._Build
                                      , OnBuild
                                      , OnDropAction);
            }

            OnPlayButton(currentParams);

            HGUIToolbar.End();

            //////////////////

            using (new GUILayoutScope(1, 0)) {
                m_treeViewR?.DrawLayoutGUI();

                var aa = GUILayoutUtility.GetLastRect();                // .GetRect( GUIContent.none, EditorStyles.label );

                var rc = m_treeViewR.m_lastCellRect;
                rc.x      = aa.x;
                rc.y     += EditorStyles.toolbar.fixedHeight;
                rc.y     += EditorGUIUtility.singleLineHeight;
                rc.y     += 8;
                rc.height = EditorGUIUtility.singleLineHeight;

                if (Utils.IsModuleInstalled(m_platform.buildTargetGroup, currentParams.buildTarget))
                {
                    rc.height = 40;
                    EditorGUI.HelpBox(rc.AlignCenterW(rc.width - 40), string.Format(S._No_0_moduleloaded_, m_UnityEditorBuildBuildPlatforms.GetModuleDisplayName(m_platform.buildTargetGroup, currentParams.buildTarget)), MessageType.Warning);
                    var rc2 = rc;
                    rc2.x     = rc.xMax - 240;
                    rc2.width = 200;
                    if (GUI.Button(rc2.AlignCenterH(20), S._InstallWithUnityHub))
                    {
                        string playbackEngineDownloadURL = UnityEditorBuildPlayerWindow.GetUnityHubModuleDownloadURL(m_platform.buildTargetGroup, currentParams.buildTarget);
                        Debug.Log(playbackEngineDownloadURL);
                        Help.BrowseURL(playbackEngineDownloadURL);
                    }
                    rc.y += 40 + 8;
                }
                m_buildPlatformDrawer?.DrawErrorReport(rc);
            }

            var lrc = GUILayoutUtility.GetLastRect();

            lrc.y      = lrc.yMax - EditorGUIUtility.singleLineHeight - 8;
            lrc.height = EditorGUIUtility.singleLineHeight;
            lrc        = lrc.AlignR(B.currentOutputPackageFullName.CalcSize(HEditorStyles.treeViewLine).x);
            lrc.x     -= 8;
            GUI.Label(lrc, B.currentOutputPackageFullName, HEditorStyles.treeViewLine);
        }
Ejemplo n.º 12
0
        //public void DrawGUI_AssetBundle() {
        //	if( !PB.i.enableAssetBundleBuild ) return;

        //	var currentParams = P.GetCurrentParams();
        //	int opt = currentParams.assetBundleOption;

        //	EditorGUI.BeginChangeCheck();
        //	using( new GUILayout.VerticalScope( EditorStyles.helpBox ) ) {
        //		bool fold;
        //		using( new GUILayout.HorizontalScope() ) {
        //			fold = HEditorGUILayout.Foldout( E.i.fold.Has( E.FoldAssetBundle ), "Asset Bundle" );
        //			E.i.fold.Toggle( E.FoldAssetBundle, fold );

        //			GUILayout.FlexibleSpace();
        //			bool b7 = HEditorGUILayout.ToggleLeft( S._ClearFiles, opt.Has( P.BUNDLE_OPTION_CLEAR_FILES ) );
        //			opt.Toggle( P.BUNDLE_OPTION_CLEAR_FILES, b7 );

        //			var rc = EditorHelper.GetLayout( EditorIcon.settings, Styles.dropDownButton, GUILayout.Width( 80 ), GUILayout.Height( 16 ) );

        //			HEditorGUI.DropDown( rc, S._Build, Styles.dropDownButton, 18,
        //				() => {
        //					if( Utils.IsSwitchPlatformAbort() ) return;
        //					ExecuteBuildBundle();
        //				},
        //				() => {
        //					var m = new GenericMenu();
        //					if( Directory.Exists( P.i.outputAssetBundleDirectory ) ) {
        //						m.AddItem( new GUIContent( SS._OpenOutputFolder ), false, () => { ShellUtils.OpenDirectory( P.i.outputAssetBundleDirectory ); } );
        //					}
        //					else {
        //						m.AddDisabledItem( new GUIContent( $"{notDirectory}{P.i.outputAssetBundleDirectory.Replace( "/", "." )}" ) );
        //					}
        //					m.DropDown( HEditorGUI.lastRect.PopupRect() );
        //				} );


        //			if( _enableAssetBundle ) {
        //				var r = EditorHelper.GetLayout( EditorIcon.settings, HEditorStyles.iconButton );
        //				if( HEditorGUI.IconButton( r, EditorIcon.settings, 2 ) ) {
        //					EditorApplication.ExecuteMenuItem( Window_AssetBundle_Browser );
        //					Event.current.Use();
        //				}
        //			}

        //			rc = HEditorGUI.lastRect;
        //			GUI.Label( rc.AddH( -3 ), GUIContent.none, HEditorStyles.dopesheetBackground );

        //		}
        //		GUILayout.Space( 2 );
        //		if( fold ) {
        //			EditorGUI.indentLevel++;
        //			bool bst = HEditorGUILayout.ToggleLeft( S._CopyingthebuildresultstoStreamingAssets, opt.Has( P.BUNDLE_OPTION_COPY_STREAMINGASSETS ) );
        //			currentParams.assetBundleCompressionMode = EditorGUILayout.Popup( S._Compression, currentParams.assetBundleCompressionMode, s_CompressionMode, Styles.miniPopup );
        //			bool b1 = HEditorGUILayout.ToggleLeft( s_BundleOptions[ 0 ], opt.Has( P.BUNDLE_OPTION_EXCLUDETYPEINFORMATION ) );
        //			bool b2 = HEditorGUILayout.ToggleLeft( s_BundleOptions[ 1 ], opt.Has( P.BUNDLE_OPTION_FORCEREBUILD ) );
        //			bool b3 = HEditorGUILayout.ToggleLeft( s_BundleOptions[ 2 ], opt.Has( P.BUNDLE_OPTION_IGNORETYPETREECHANGES ) );
        //			bool b4 = HEditorGUILayout.ToggleLeft( s_BundleOptions[ 3 ], opt.Has( P.BUNDLE_OPTION_APPENDHASH ) );
        //			bool b5 = HEditorGUILayout.ToggleLeft( s_BundleOptions[ 4 ], opt.Has( P.BUNDLE_OPTION_STRICTMODE ) );
        //			bool b6 = HEditorGUILayout.ToggleLeft( s_BundleOptions[ 5 ], opt.Has( P.BUNDLE_OPTION_DRYRUNBUILD ) );

        //			opt.Toggle( P.BUNDLE_OPTION_COPY_STREAMINGASSETS, bst );
        //			opt.Toggle( P.BUNDLE_OPTION_EXCLUDETYPEINFORMATION, b1 );
        //			opt.Toggle( P.BUNDLE_OPTION_FORCEREBUILD, b2 );
        //			opt.Toggle( P.BUNDLE_OPTION_IGNORETYPETREECHANGES, b3 );
        //			opt.Toggle( P.BUNDLE_OPTION_APPENDHASH, b4 );
        //			opt.Toggle( P.BUNDLE_OPTION_STRICTMODE, b5 );
        //			opt.Toggle( P.BUNDLE_OPTION_DRYRUNBUILD, b6 );
        //			GUILayout.Space( 2 );

        //			EditorGUI.indentLevel--;
        //		}
        //	}
        //	if( EditorGUI.EndChangeCheck() ) {
        //		currentParams.assetBundleOption = opt;
        //		Utils.s_changed = true;
        //	}
        //}


        /////////////////////////////////////////

        void DrawToolBar()
        {
            HGUIToolbar.Begin();

            if (HGUIToolbar.Button(EditorIcon.settings))
            {
                SharedModule.SettingsWindow.OpenProject(Package.nameNicify);
            }

            if (HGUIToolbar.Toggle(P.i.selectScene, "Scenes in Build", EditorIcon.sceneasset))
            {
                P.i.selectScene = true;
                P.Save();
            }

            var lst = m_supportBuildTarget.Where(x => P.GetPlatform(x).enable).ToArray();

            var reo    = Styles.toolbarbutton.padding;
            var active = UnityEditorEditorUserBuildSettings.activeBuildTargetGroup;

            for (int i = 0; i < lst.Length; i++)
            {
                var s = lst[i];

                var style = active == s ? Styles.toolbarbuttonActive : Styles.toolbarbutton;

                var cont = EditorHelper.TempContent(s.GetShortName(), s.Icon());
                var size = style.CalcSize(cont);
                size.x -= 8;

                bool bb = P.i.selectScene || P.i.selectScene;

                ScopeChange.Begin();
                if (HGUIToolbar.Toggle(P.i.selectBuildTargetGroup == s && !bb, cont, style, GUILayout.Width(size.x)))
                {
                    P.i.selectScene = false;
                    P.Save();

                    P.i.selectBuildTargetGroup = s;
                    Utils.SelectItemUpdate();
                    ChangeActiveTarget();
                    m_Drawer_BuildPlatforms.SelectPlatform(Utils.s_currentPlatform, m_buildPlatformDrawer);
                }
                if (ScopeChange.End())
                {
                    P.Save();
                }

                if (active == s)
                {
                    var rc = GUILayoutUtility.GetLastRect();
                    EditorGUI.DrawRect(rc, new Color(0, 0, 1, 0.1f));

                    rc.x -= 4;
                    rc    = rc.AlignCenterH(16);
                    if (UnitySymbol.Has("UNITY_2019_3_OR_NEWER"))
                    {
                        rc.y += 1;
                    }
                    GUI.DrawTexture(rc.AlignR(16), EditorIcon.buildsettings_editor_small, ScaleMode.ScaleToFit);
                }
            }

            GUILayout.FlexibleSpace();
            if (_enableBuildReport)
            {
                if (HGUIToolbar.Button("Build Report"))
                {
                    EditorApplication.ExecuteMenuItem(Window_Show_Build_Report);
                }
            }


            HGUIToolbar.End();
        }