Exemple #1
0
        /////////////////////////////////////////
        protected override void OnRowGUI(Item item, RowGUIArgs args)
        {
            m_lastCellRect = args.rowRect;

            if (item.uiDraw != null)
            {
                var p = P.GetCurrentParams();
                ScopeDisable.Begin(item.uiDraw.isDisable(p));

                DefaultRowGUI(args);

                var rect = args.rowRect;
                ScopeChange.Begin();
                if (item.uiDraw.UIDraw(rect.TrimL(250), p))
                {
                    m_buildPlatformDrawer.CheckError();
                }
                ScopeChange.End();

                ScopeDisable.End();
            }
            else
            {
                DefaultRowGUI(args);
            }
        }
        /////////////////////////////////////////
        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;
            }
        }
Exemple #3
0
        /////////////////////////////////////////
        public static void DrawGUI()
        {
            E.Load();

            ScopeChange.Begin();

            E.i.Enable = HEditorGUILayout.ToggleLeft(SS._Enable, E.i.Enable);
            EditorGUI.indentLevel++;
            GUILayout.Space(8f);
            using (new EditorGUI.DisabledGroupScope(!E.i.Enable)) {
                E.i.multiSceneExec = HEditorGUILayout.ToggleLeft(S._Executeevenwithmultiplesceneviews, E.i.multiSceneExec);

                E.i.enableTimeScaleSlider = HEditorGUILayout.ToggleLeft(S._TimeScaleSlider, E.i.enableTimeScaleSlider);
                E.i.syncScene2Game        = HEditorGUILayout.ToggleLeft(S._Syncscenecameratogamecamera, E.i.syncScene2Game);
                E.i.toggleOrthographic    = HEditorGUILayout.ToggleLeft(S._ToggleOrthographic, E.i.toggleOrthographic);

                E.i.uiBkColor = EditorGUILayout.ColorField(SS._BackColor, E.i.uiBkColor);
                E.i.textColor = EditorGUILayout.ColorField(SS._TextColor, E.i.textColor);

                GUILayout.Space(8f);

                /////////////////////////
                HEditorGUILayout.HeaderTitle($"* {SS._Experimental}");

                E.i.tools        = HEditorGUILayout.ToggleLeft("Tool (UNITY_2019_1_OR_NEWER)", E.i.tools);
                E.i.drawPivotBox = HEditorGUILayout.ToggleLeft("Draw Pivot Box", E.i.drawPivotBox);
                EditorGUI.indentLevel++;
                ScopeDisable.Begin(!E.i.drawPivotBox);
                E.i.drawPivotLabel = HEditorGUILayout.ToggleLeft("Label", E.i.drawPivotLabel);
                ScopeDisable.End();
                EditorGUI.indentLevel--;

                E.i.raycastPivot     = HEditorGUILayout.ToggleLeft("RayCast Pivot (Alt)", E.i.raycastPivot);
                E.i.resetPivotSize   = HEditorGUILayout.ToggleLeft("Reset Pivot Size (G)", E.i.resetPivotSize);
                E.i.disableSelection = HEditorGUILayout.ToggleLeft("Disable Selection (Space)", E.i.disableSelection);

                E.i.mouseDrag = HEditorGUILayout.ToggleLeft("Hide the mouse when dragging (UNITY_EDITOR_WIN)", E.i.mouseDrag);
                E.i.crossLine = HEditorGUILayout.ToggleLeft("Draw the axis from the origin", E.i.crossLine);

                GUILayout.Space(8f);


                /////////////////////////
                HEditorGUILayout.HeaderTitle($"* Obsolete");

                E.i.wsadMove = HEditorGUILayout.ToggleLeft("Pivot Move (W,A,S,D,Q,E)", E.i.wsadMove);

                GUILayout.Space(8f);
            }
            EditorGUI.indentLevel--;
            //}

            if (ScopeChange.End())
            {
                SceneViewTools.InitDragMouse();
                E.Save();
                SceneViewUtils.Repaint();
            }
        }
        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();
        }
        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();
        }
Exemple #6
0
        /////////////////////////////////////////
        public override void OnDefaultGUI()
        {
            ScopeIsCompile.Begin();

            DrawToolBar();

            var ww = (position.width - 40) * 0.5f;

            ScopeHorizontal.Begin();

            /////////////////////////////////////////
            ScopeVertical.Begin(GUILayout.Width(ww));
            DrawLeftPane();
            ScopeVertical.End();

            /////////////////////////////////////////
            ScopeVertical.Begin(HEditorStyles.dopesheetBackground, GUILayout.Width(40));
            GUILayout.FlexibleSpace();

            ScopeDisable.Begin(!m_treeViewL.HasSelection());
            if (GUILayout.Button(">>"))
            {
                m_treeViewL.選択パッケージをアンインストール指定する();
            }
            ScopeDisable.End();

            GUILayout.Space(16);
            ScopeDisable.Begin(!m_treeViewR.HasSelection());
            if (GUILayout.Button("<<"))
            {
                m_treeViewR.選択パッケージをインストール指定する();
            }
            ScopeDisable.End();

            GUILayout.FlexibleSpace();
            ScopeVertical.End();

            /////////////////////////////////////////
            ScopeVertical.Begin(HEditorStyles.dopesheetBackground, GUILayout.Width(ww));
            DrawRightPane();
            ScopeVertical.End();

            ScopeHorizontal.End();
            ScopeIsCompile.End();
        }
Exemple #7
0
        /////////////////////////////////////////
        protected override void OnRowGUI(PackageTreeItem item, RowGUIArgs args)
        {
            ScopeDisable.Begin(item.install);
            Label(args, args.rowRect, $"{item.displayName}", item.icon);
            ScopeDisable.End();

            if (item.uninstall)
            {
                GUI.DrawTexture(args.rowRect.AlignR(16), EditorIcon.warning);
            }

            var lrc  = args.rowRect;
            var cont = EditorHelper.TempContent($"{item.version}");
            var size = HEditorStyles.versionLabel.CalcSize(cont);

            lrc    = lrc.AlignR(size.x);
            lrc.x -= 4;
            lrc    = lrc.AlignCenterH(12);
            EditorGUI.DrawRect(lrc, SharedModule.SettingsEditor.i.versionBackColor);
            HEditorStyles.versionLabel.normal.textColor = SharedModule.SettingsEditor.i.versionTextColor;
            GUI.Label(lrc, $"{item.version}", HEditorStyles.versionLabel);
        }
        /////////////////////////////////////////
        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);
        }
Exemple #9
0
        public static void DrawGUI()
        {
            E.Load();

            HEditorGUILayout.HeaderTitle(SS._General);

            if (m_localeNames == null)
            {
                m_localeNames = new List <EditorLocalize.LCIDString>();               // EditorLocalize.s_lcidTable.OrderBy( x => x.NAME ).ToList();
                var files = "95cedfc7731853946b0b3650f175d73a".GetFilesFromAssetGUID().Select(x => x.FileNameWithoutExtension()).ToList();
                foreach (var rp in files)
                {
                    var p = EditorLocalize.s_lcidTable.Find(x => x.LCID == rp);
                    if (p == null)
                    {
                        continue;
                    }
                    m_localeNames.Add(p);
                }
                m_localeNames = m_localeNames.OrderBy(x => x.NAME).ToList();
            }

            ScopeChange.Begin();
            var idx = m_localeNames.FindIndex(x => x.LCID == E.i.LCID);

            if (idx < 0)
            {
                idx = m_localeNames.FindIndex(x => x.LCID == "en-US");
            }
            idx = EditorGUILayout.Popup(S._Language, idx, m_localeNames.Select(x => x.NAME).ToArray());
            if (ScopeChange.End())
            {
                E.i.LCID = m_localeNames[idx].LCID;
                E.LoadLocalize();
                E.Save();
            }

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

            ScopeChange.Begin();
            GUILayout.Space(4);
            var _versionTextColor = EditorGUILayout.ColorField(S._VersionTextColor, E.i.versionTextColor.value);

            var _versionBackColor = EditorGUILayout.ColorField(S._VersionBackColor, E.i.versionBackColor.value);

            var _windowShade = HEditorGUILayout.ToggleLeft(S._WindowShade, E.i.m_windowShade);

            var _uielementsFontFix = HEditorGUILayout.ToggleLeft("UIElements Font Fix", E.i.m_uielementsFontFix);

            if (ScopeChange.End())
            {
                E.i.versionTextColor.value = _versionTextColor;
                E.i.versionBackColor.value = _versionBackColor;
                E.i.m_windowShade          = _windowShade;
                E.i.m_uielementsFontFix    = _uielementsFontFix;
                E.Save();
                EditorWindowUtils.RepaintProjectWindow();
            }

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

            ScopeChange.Begin();

            GUILayout.Space(8);

            HEditorGUILayout.HeaderTitle("AssetPostprocessor");

            E.i.m_asmdefNameSync = HEditorGUILayout.ToggleLeft(S._MaketheNamefieldthesameasthefilenamewhenimportingasmdef, E.i.m_asmdefNameSync);
            ScopeDisable.Begin(true);
            E.i.m_asmdefAutoReferenceOFF = HEditorGUILayout.ToggleLeft(S._TurnoffAutoReferencedwhenimportingasmdef, E.i.m_asmdefAutoReferenceOFF);
            if (E.i.m_asmdefAutoReferenceOFF)
            {
                E.i.m_asmdefAutoReferenceOFF = false;
                E.Save();
            }
            ScopeDisable.End();
            //E.i.m_disableSyncVS = HEditorGUILayout.ToggleLeft( "Kill SyncVS", E.i.m_disableSyncVS );
            //E.i.utilityWindow = EditorGUILayout.ToggleLeft( SS._UtilityWindowMode, E.i.utilityWindow );
            if (ScopeChange.End())
            {
                E.Save();
            }

            //////////////////////////////////
            GUILayout.Space(8);

            HEditorGUILayout.HeaderTitle(S._WheretosaveProjectsettings);

            HEditorGUILayout.PreviewFolder(E.i.GetProjectSettingsPath(), OnProjectFolderPreset);

            GUILayout.Space(8f);
            ScopeHorizontal.Begin();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(SS._ReturnToDefault))
            {
                E.i.versionTextColor = new EditorColor(ColorUtils.RGB(72), ColorUtils.RGB(173));
                E.i.versionBackColor = new EditorColor(ColorUtils.RGB(242), ColorUtils.RGB(41));
                //E.i.utilityWindow = false;
                E.Save();
            }
            ScopeHorizontal.End();

            //HGUILayout.LinkLabel( "hoge" );

            //#if ENABLE_HANANOKI_SETTINGS && LOCAL_TEST
            //			using( new GUILayout.HorizontalScope() ) {
            //				GUILayout.FlexibleSpace();
            //				if( GUILayout.Button( "Open Settings" ) ) {
            //					SettingsWindow.Open();
            //				}
            //			}
            //#endif
        }