Example #1
0
        static void DrawContentPlatfom()
        {
            EditorGUI.BeginChangeCheck();

            var targetGroupList = PlatformUtils.GetSupportList();

            GUILayout.BeginVertical(EditorStyles.helpBox);
            GUILayout.Label(S._Selectplatformtouse);
            foreach (var t in targetGroupList)
            {
                EditorGUI.BeginChangeCheck();
                var _b = HEditorGUILayout.ToggleLeft(P.GetPlatform(t).enable, t.Icon(), t.GetName());
                if (EditorGUI.EndChangeCheck())
                {
                    P.GetPlatform(t).enable = _b;
                    BuildAssistWindow.ChangeActiveTarget();
                }
            }
            GUILayout.EndVertical();

            if (EditorGUI.EndChangeCheck())
            {
                s_changed = true;
            }
        }
        public static void DrawGUI()
        {
            E.Load();
            P.Load();
            var targetGroupList = PlatformUtils.GetSupportList();

            ScopeIsCompile.Begin();

            ScopeVertical.Begin();
            HEditorGUILayout.HeaderTitle("Platform");
            GUILayout.Space(8);
            foreach (var t in targetGroupList)
            {
                ScopeChange.Begin();

                var _b = HEditorGUILayout.ToggleBox(P.i.supportPlatform[(int)t], t.Icon(), t.GetName());
                if (ScopeChange.End())
                {
                    P.i.supportPlatform[(int)t] = _b;
                    P.Save();
                    //BuildAssistWindow.ChangeActiveTarget();
                    Utils.m_treeView_EditorSymbols = null;
                }
            }
            ScopeVertical.End();

            ScopeIsCompile.End();
        }
Example #3
0
        public static void DrawGUI()
        {
#if UNITY_2018_3_OR_NEWER
            using (new GUILayout.HorizontalScope()) {
                if (GUILayout.Button("add"))
                {
                    var m    = new GenericMenu();
                    var list = AssemblieUtils.SubclassesOf <EditorWindow>()
                               .OrderBy(x => x.Assembly.FullName)
                               .ThenBy(x => x.FullName);
                    foreach (var p in list)
                    {
                        var asmName = p.Assembly.FullName.Split(',')[0];
                        m.AddItem($"{asmName[ 0 ]}/{asmName}/{p.Name}", reg, p);
                    }
                    m.DropDownAtMousePosition();
                    void reg(object context)
                    {
                        var t = (Type)context;

                        if (E.i.utilityWindowSettingsData.Find(x => x.TypeFullName == t.FullName) == null)
                        {
                            E.i.utilityWindowSettingsData.Add(new UtilityWindowSettingsData {
                                Enable = true, TypeFullName = t.FullName
                            });
                        }
                        CheckNullType();
                        E.Save();
                    }
                }

                if (GUILayout.Button("remove"))
                {
                    E.i.utilityWindowSettingsData = new List <UtilityWindowSettingsData>();
                }
            }


            UtilityWindowSettingsData _remove = null;

            foreach (var p in E.i.utilityWindowSettingsData)
            {
                EditorGUI.BeginChangeCheck();
                p.Enable = HEditorGUILayout.ToggleBox($"{p.GetUtilityType().FullName}", p.Enable, EditorIcon.minus, OnButton);
                if (EditorGUI.EndChangeCheck())
                {
                    E.Save();
                }
                void OnButton()
                {
                    _remove = p;
                }
            }
            if (_remove != null)
            {
                E.i.utilityWindowSettingsData.Remove(_remove);
                E.Save();
            }
#endif
        }
        /// <summary>
        ///
        /// </summary>
        public static void DrawGUI()
        {
            E.Load();

            EditorGUI.BeginChangeCheck();

            E.i.enablePingObject  = HEditorGUILayout.ToggleLeft(S._EnablePingObject, E.i.enablePingObject);
            E.i.recordObjectCount = EditorGUILayout.IntSlider(S._RecordObjectCount, E.i.recordObjectCount, 2, 128);

            using (new GUILayout.HorizontalScope()) {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(S._Apply))
                {
                    SelectionHistoryParameter.instance.Init(E.i.recordObjectCount);
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
                s_changed = true;
            }


            if (s_changed)
            {
                E.Save();
            }

            GUILayout.Space(8f);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        private static void DrawGUI()
        {
            using (new PreferenceLayoutScope())
            {
                EditorGUI.BeginChangeCheck();
                Pref.i.enableProjectSettingsProvider = HEditorGUILayout.ToggleLeft(S._ProjectSettingsProvider, Pref.i.enableProjectSettingsProvider);
                Pref.i.iconOpenCSProject             = HEditorGUILayout.GUIDObjectField <Texture2D>(nameof(Pref.i.iconOpenCSProject).nicify(), Pref.i.iconOpenCSProject);

                if (EditorGUI.EndChangeCheck())
                {
                    EditorToolbar.s_styles.LoadProjectIcon();
                    EditorToolbar.Repaint();
                    Pref.Save();
                }

                if (Pref.i.enableProjectSettingsProvider)
                {
                    return;
                }

                GUILayout.Space(8f);

                GUILayout.Label(S._ProjectSettings, "ShurikenModuleTitle");
#if UNITY_2018_3_OR_NEWER
                EditorToolbarSettingsProvider.DrawGUI();
#endif
            }
        }
        /////////////////////////////////////////

        public static void DrawGUI()
        {
            //E.Load();
            P.Load();
            var targetGroupList = PlatformUtils.GetSupportList();

            ScopeIsCompile.Begin();

            ScopeVertical.Begin();
            HEditorGUILayout.HeaderTitle("Platform");
            GUILayout.Space(8);
            foreach (var t in targetGroupList)
            {
                ScopeChange.Begin();

                var _b = HEditorGUILayout.ToggleBox(P.GetPlatform(t).enable, t.Icon(), t.GetName());
                if (ScopeChange.End())
                {
                    P.GetPlatform(t).enable = _b;
                    P.Save();
                    BuildAssistWindow.ChangeActiveTarget();
                }
            }
            ScopeVertical.End();

            ScopeIsCompile.End();
        }
Example #7
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();
            }
        }
        /// <summary>
        ///
        /// </summary>
        static void DrawGUI()
        {
            EditorGUI.BeginChangeCheck();

            using (new PreferenceLayoutScope(ref s_scrollPos)) {
                E.i.Enable = HEditorGUILayout.ToggleLeft(SS._Enable, E.i.Enable);
                EditorGUI.indentLevel++;
                GUILayout.Space(8f);

                using (new EditorGUI.DisabledGroupScope(!E.i.Enable)) {
                    E.i.showExtension = HEditorGUILayout.ToggleLeft(S._ShowExtension, E.i.showExtension);
                    using (new EditorGUI.DisabledGroupScope(!E.i.showExtension)) {
                        EditorGUI.indentLevel++;
                        E.i.extBackColor = EditorGUILayout.ColorField(SS._BackColor, E.i.extBackColor);
                        E.i.extTextColor = EditorGUILayout.ColorField(SS._TextColor, E.i.extTextColor);
                        EditorGUI.indentLevel--;
                    }

                    E.i.showLineColor = HEditorGUILayout.ToggleLeft(SS._Changecolorforeachrow, E.i.showLineColor);

                    using (new EditorGUI.DisabledGroupScope(!E.i.showLineColor)) {
                        EditorGUI.indentLevel++;
                        E.i.lineColor = EditorGUILayout.ColorField(SS._Rowcolor, E.i.lineColor);
                        EditorGUI.indentLevel--;
                    }

                    GUILayout.Space(8f);
                    EditorGUILayout.LabelField($"* {SS._Experimental}", EditorStyles.boldLabel);
                    E.i.IconClickContext = HEditorGUILayout.ToggleLeft(SS._ContextMenuWithIconClick, E.i.IconClickContext);
                    if (UnitySymbol.Has("UNITY_EDITOR_WIN"))
                    {
                        using (new EditorGUI.DisabledGroupScope(!E.i.showExtension)) {
                            E.i.enableExtensionRun = HEditorGUILayout.ToggleLeft(S._Clickontheextensiontorunitinthefiler, E.i.enableExtensionRun);
                        }
                    }
                    else
                    {
                        E.i.enableExtensionRun = false;
                    }
                    E.i.adressableSupport = HEditorGUILayout.ToggleLeft(S._EnablingAddressablesupport, E.i.adressableSupport);
                }
                EditorGUI.indentLevel--;
            }

            GUILayout.Space(8f);


            if (EditorGUI.EndChangeCheck())
            {
                E.Save();
                CustomProjectBrowser.s_styles.lineColor = E.i.lineColor;
                EditorApplication.RepaintProjectWindow();
            }

            GUILayout.Space(8f);
        }
        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();
        }
Example #10
0
        public void Draw(BuildAssistWindow parent)
        {
            var currentParams = P.GetCurrentParams();

            parent.DrawGUI_PackageName();
            parent.DrawGUI_ConfigurationSelect();

            parent.DrawGUI_AssetBundle();
            parent.DrawGUI_BuildSettings();
            parent.DrawGUI_PlayerSettings();

            DrawGUI_WebGL(currentParams);

            parent.DrawGUI_OutputDirectory();



            bool once = false;

            void errorLabel(string s, string icon = "")
            {
                var c = EditorStyles.label.normal.textColor;

                EditorStyles.label.normal.textColor = Color.red;
                EditorStyles.label.fontStyle        = FontStyle.Bold;

                GUILayout.Label(EditorHelper.TempContent(s, Icon.Get(icon)), EditorStyles.label);

                EditorStyles.label.fontStyle        = FontStyle.Normal;
                EditorStyles.label.normal.textColor = c;
            }

            void errorTitle()
            {
                if (once)
                {
                    return;
                }
                errorLabel("PlayerSettings.Standalone settings are incomplete", "console.erroricon.sml");
                once = true;
            }

            if (currentParams.development)
            {
                HEditorGUILayout.BoldLabel(SS._Info, EditorIcon.Info);
                HEditorGUILayout.BoldLabel(S._NotethatWebGLdevelopmentbuildsaremuchlargerthanreleasebuildsandshoundnotbepublicsed);
            }

            GUILayout.FlexibleSpace();
            parent.DrawGUI_Bottom();
        }
Example #11
0
        /////////////////////////////////////////
        public static void DrawGUI()
        {
            E.Load();

            ScopeChange.Begin();

            E.i.enablePackageAsmdef = HEditorGUILayout.ToggleLeft("enablePackageAsmdef".nicify(), E.i.enablePackageAsmdef);

            if (ScopeChange.End())
            {
                //s_changed = true;
                E.Save();
            }
        }
Example #12
0
        public override void OnDefaultGUI()
        {
            //////////////////////
            EditorGUILayout.LabelField("Assembly Definition References", EditorStyles.boldLabel);
            ScopeVertical.Begin(EditorStyles.helpBox);
            foreach (var e in m_reference)
            {
                e.toggle = HEditorGUILayout.ToggleLeft(e.asmname, e.toggle);
            }
            ScopeVertical.End();


            //////////////////////
            GUILayout.FlexibleSpace();
            ScopeHorizontal.Begin();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Apply"))
            {
                Apply();
            }
            GUILayout.Space(8);
            ScopeHorizontal.End();
            GUILayout.Space(8);
        }
Example #13
0
        void DrawGUI_WebGL(P.Params currentParams)
        {
            int opt = currentParams.platformOption;

            using (new GUILayout.VerticalScope(Styles.helpBox)) {
                EditorGUI.BeginChangeCheck();
                var fold = HEditorGUILayout.Foldout(E.i.fold.Has(E.FoldPlayerSettingsWebGL), "WebGL");
                E.i.fold.Toggle(E.FoldPlayerSettingsWebGL, fold);
                if (EditorGUI.EndChangeCheck())
                {
                    s_changed = true;
                }

                EditorGUI.BeginChangeCheck();
                if (fold)
                {
                    EditorGUI.indentLevel++;
                    using (new GUILayout.HorizontalScope()) {
                        currentParams.WebGL_compressionFormat = (WebGLCompressionFormat)EditorGUILayout.EnumPopup(S._CompressionFormat, currentParams.WebGL_compressionFormat);
                        if (HEditorGUILayout.IconButton(Styles.iconHelp, 3))
                        {
                            EditorUtility.DisplayDialog(SS._Info, $@"Brotli (default: 2019.1~):
{S._WebGLresourcesarestoredusingBrotlicompression_}

Gzip (default: ~2018.4):
{S._WebGLresourcesarestoredusingGzipcompression_}

Disabled:
{S._WebGLresourcesareuncompressed_}", SS._OK);
                        }
                    }
                    using (new GUILayout.HorizontalScope()) {
                        currentParams.WebGL_linkerTarget = (WebGLLinkerTarget)EditorGUILayout.EnumPopup(S._LinkerTarget, currentParams.WebGL_linkerTarget);
                        if (HEditorGUILayout.IconButton(Styles.iconHelp, 3))
                        {
                            EditorUtility.DisplayDialog(SS._Info, $@"Asm:
{S._Onlyasm_jsoutputwillbegenerated_Thissettinghasbeendeprecated_}

Wasm (default):
{S._OnlyWebAssemblyoutputwillbegenerated_ThiswillrequireabrowserwithWebAssemblysupporttorunthegeneratedcontent_}

Both:
{S._Bothasm_jsandWebAssemblyoutputwillbegenerated_TheWebAssemblyversionofthegeneratedcontentwillbeusedifsupportedbythebrowser_otherwise_theasm_jsversionwillbeused_Thissettinghasbeendeprecated_}", SS._OK);
                        }
                    }
                    string[] memS = { "16MB", "32MB", "64MB", "128MB", "256MB", "512MB", "1GB", "2GB", "4GB", "8GB" };
                    int[]    memI = { 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192 };
                    int      idx  = ArrayUtility.IndexOf(memI, currentParams.WebGL_memorySize);
                    if (idx < 0)
                    {
                        idx = 1;
                    }
                    idx = EditorGUILayout.Popup(S._MemorySize, idx, memS);
                    currentParams.WebGL_memorySize = memI[idx];
                    using (new GUILayout.HorizontalScope()) {
                        currentParams.WebGL_exceptionSupport = (WebGLExceptionSupport)EditorGUILayout.EnumPopup(S._EnableExceptions, currentParams.WebGL_exceptionSupport);
                        if (HEditorGUILayout.IconButton(Styles.iconHelp, 3))
                        {
                            EditorUtility.DisplayDialog(SS._Info, $@"None:
{S._Disableexceptionsupport_}

Explicitly Thrown Exceptions Only (default):
{S._Enablethrowsupport_}

Full Without Stacktrace:
{S._Enableexceptionsupportforallexceptions_withoutstacktraceinformation_}

Full With Stacktrace:
{S._Enableexceptionsupportforallexceptions_includingstacktraceinformation_}
", SS._OK);
                        }
                    }

                    if (UnitySymbol.Has("UNITY_2019_1_OR_NEWER"))
                    {
                        using (new GUILayout.HorizontalScope()) {
                            currentParams.WebGL_wasmStreaming = EditorGUILayout.ToggleLeft(S._WebAssemblyStreaming, currentParams.WebGL_wasmStreaming);
                            if (HEditorGUILayout.IconButton(Styles.iconHelp, 3))
                            {
                                EditorUtility.DisplayDialog(SS._Info, $@"{S._EnableWebAssemblystreamingcompilation_}
{S._Whenenabled_UnitycompilestheWebAssemblybinaryfilewhilethefiledownloads_Thissettingrequiresan_application_wasm_mimetype_sosetuptheserveraccordingly_}", SS._OK);
                            }
                        }
                        using (new GUILayout.HorizontalScope()) {
                            currentParams.WebGL_threadsSupport = EditorGUILayout.ToggleLeft(S._EnableMultiThread, currentParams.WebGL_threadsSupport);
                            if (HEditorGUILayout.IconButton(Styles.iconHelp, 3))
                            {
                                EditorUtility.DisplayDialog(SS._Info, $@"{S._EnableMultithreadingsupport_}
{S._Whenenabled_Unityoutputsabuildwithmultithreadingsupport_ThegeneratedcontentrequiresabrowserthatsupportsWebAssemblythreads_Thisisanexperimentalfeatureandshouldonlybeusedfortestingpurposes_}", SS._OK);
                            }
                        }
                    }
                    EditorGUI.indentLevel--;
                }
                if (EditorGUI.EndChangeCheck())
                {
                    currentParams.platformOption = opt;
                    s_changed = true;
                }
            }
        }
Example #14
0
        /// <summary>
        /// GUI 下部のビルド開始ボタン等の描画を行います
        /// </summary>
        public void DrawGUI_Bottom()
        {
            var currentParams = P.GetCurrentParams();

            using (new GUILayout.HorizontalScope()) {
                GUILayout.FlexibleSpace();
                GUILayout.Label(P.currentOutputPackageFullName);
            }
            using (new GUILayout.HorizontalScope()) {
                GUILayout.FlexibleSpace();

                using (new EditorGUI.DisabledGroupScope(!currentParams.development)) {
                    bool b2 = HEditorGUILayout.SessionToggleLeft(S._ConnectProfiler, S._ProfilingisonlyenabledinaDevelopmentPlayer, E.connectProfiler.Value);
                    E.connectProfiler.Value = b2;
                }
                bool b3 = HEditorGUILayout.SessionToggleLeft(S._AutoRunPlayer, E.autoRunPlayer.Value);
                E.autoRunPlayer.Value = b3;
                //GUILayout.Space( 16 );

                var rc = GUILayoutUtility.GetRect(EditorHelper.TempContent(S._SwitchPlatform, EditorIcon.Warning), GUI.skin.button, GUILayout.Width(150));


                void OnDropAction()
                {
                    var m = new GenericMenu();

                    if (Directory.Exists(P.currentOutputPackageDirectory))
                    {
                        m.AddItem(SS._OpenOutputFolder.content(), false, () => {
                            EditorUtils.ShellOpenDirectory(P.currentOutputPackageDirectory);
                        });
                    }
                    else
                    {
                        m.AddDisabledItem($"{notDirectory}{P.currentOutputPackageDirectory.Replace( "/", "." )}]".content());
                    }
                    m.AddSeparator("");
                    if (PB.i.enableAssetBundleBuild)
                    {
                        m.AddItem(S._BuildAssetBundletogether.content(), currentParams.buildAssetBundlesTogether, () => { currentParams.buildAssetBundlesTogether = !currentParams.buildAssetBundlesTogether; });
                    }
                    if (UnitySymbol.Has("UNITY_EDITOR_WIN"))
                    {
                        m.AddItem(S._CreateabuildBATfile, false, () => {
                            var tname = $"{UnityEditorUserBuildSettings.activeBuildTargetGroup.ToString()}_{currentParams.name}";
                            EditorHelper.WriteFile($"Build_{tname}.bat", b => {
                                b.AppendLine($"@echo off");
                                b.AppendLine($"set PATH=%PATH%;{EditorApplication.applicationPath.GetDirectory()}");
                                b.AppendLine($"set OPT1=-batchmode -nographics");
                                b.AppendLine($"set BUILD=-buildTarget {B.BuildTargetToBatchName( currentParams.buildTarget )}");
                                b.AppendLine($"set PROJ=-projectPath {Environment.CurrentDirectory}");
                                b.AppendLine($"set LOG=-logFile \"Logs/Editor_{tname}.log\"");
                                b.AppendLine($"set METHOD=-executeMethod Hananoki.{Package.name}.{nameof( BuildCommands )}.Batch -buildIndex:{P.i.selectParamsIndex}");
                                b.AppendLine($"Unity.exe %OPT1% %BUILD% %PROJ% %LOG% %METHOD% -quit");
                                b.AppendLine($"pause");
                            }, utf8bom: false);
                            EditorUtility.DisplayDialog(SS._Confirm, $"{S._BuildBATcreated}\n{Environment.CurrentDirectory}/{$"Build_{tname}.bat"}", SS._OK);
                        });
                    }
                    m.DropDown(HEditorGUI.lastRect.PopupRect());
                }

                if (UnityEditorUserBuildSettings.activeBuildTargetGroup != P.i.selectBuildTargetGroup)
                {
                    HEditorGUI.DropDown(rc, EditorHelper.TempContent(S._SwitchPlatform, EditorIcon.Warning), Styles.dropDownButton, 20,
                                        () => PlatformUtils.SwitchActiveBuildTarget(P.i.selectBuildTargetGroup),
                                        OnDropAction
                                        );
                }
                else
                {
                    HEditorGUI.DropDown(rc, E.autoRunPlayer.Value ? S._BuildAndRun : S._Build, Styles.dropDownButton, 20,
                                        () => {
                        if (IsSwitchPlatformAbort())
                        {
                            return;
                        }
                        ExecuteBuildPackage();
                    },
                                        OnDropAction);
                }
                rc = HEditorGUI.lastRect;
                GUI.Label(rc.AddH(-3), GUIContent.none, Styles.dopesheetBackground);
                if (UnitySymbol.Has("UNITY_EDITOR_WIN"))
                {
                    if (P.GetSelectPlatform().buildTargetGroup == BuildTargetGroup.Standalone)
                    {
                        if (File.Exists(P.currentOutputPackageFullName))
                        {
                            if (HEditorGUILayout.ImageButton(EditorIcon.PlayButton, GUILayout.Width(30)))
                            {
                                System.Diagnostics.Process.Start(P.currentOutputPackageFullName);
                            }
                        }
                    }
                    if (P.GetSelectPlatform().buildTargetGroup == BuildTargetGroup.WebGL)
                    {
                        if (File.Exists($"{P.currentOutputPackageFullName}/index.html"))
                        {
                            if (HEditorGUILayout.ImageButton(EditorIcon.PlayButton, GUILayout.Width(30)))
                            {
                                //System.Diagnostics.Process.Start( $"{P.currentOutputPackageFullName}/index.html" );
                                Application.OpenURL("http://localhost/");
                            }
                        }
                    }
                }
            }
            GUILayout.Space(10);
        }
Example #15
0
        /// <summary>
        ///
        /// </summary>
        public void DrawGUI_OutputDirectory()
        {
            var  currentParams = P.GetCurrentParams();
            bool fold;
            bool _outputDirectoryAuto    = currentParams.outputDirectoryAuto;
            bool _outputUseConfiguration = currentParams.outputUseConfiguration;

            using (new GUILayout.VerticalScope(Styles.helpBox)) {
                using (new GUILayout.HorizontalScope()) {
                    EditorGUI.BeginChangeCheck();
                    fold = HEditorGUILayout.Foldout(E.i.fold.Has(E.FoldOutputDirectory), "Output Directory");
                    E.i.fold.Toggle(E.FoldOutputDirectory, fold);
                    if (EditorGUI.EndChangeCheck())
                    {
                        s_changed = true;
                    }

                    GUILayout.FlexibleSpace();
                    var r = GUILayoutUtility.GetRect(20, 18);
                }


                if (fold)
                {
                    EditorGUI.BeginChangeCheck();
                    EditorGUI.indentLevel++;

                    EditorGUI.BeginChangeCheck();
                    using (new GUILayout.HorizontalScope()) {
                        _outputDirectoryAuto = HEditorGUILayout.ToggleLeft(S._Autosetting, _outputDirectoryAuto);
                        using (new EditorGUI.DisabledGroupScope(!_outputDirectoryAuto)) {
                            _outputUseConfiguration = HEditorGUILayout.ToggleLeft(S._UseConfigurationName, _outputUseConfiguration);
                        }
                        GUILayout.FlexibleSpace();
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        if (_outputDirectoryAuto)
                        {
                            currentParams.outputDirectoryAuto    = _outputDirectoryAuto;
                            currentParams.outputUseConfiguration = _outputUseConfiguration;
                            MakeDefaultOutputDirectory();
                        }
                        s_changed = true;
                    }

                    string _outputDirectory = currentParams.outputDirectory;
                    var    rect             = GUILayoutUtility.GetRect(_outputDirectory.content(), EditorStyles.label, GUILayout.Height(16));

                    var r1 = rect;
                    r1.width -= 16;
                    EditorGUI.LabelField(r1, SS._Directory, _outputDirectory);
                    if (!_outputDirectoryAuto)
                    {
                        var r2 = rect;
                        r2.x     = r1.xMax;
                        r2.width = 16;
                        if (HEditorGUI.IconButton(r2, Icon.Get("Folder Icon")))
                        {
                            var _path = EditorUtility.OpenFolderPanel(S._SelectOutputDirectory, _outputDirectory, "");
                            if (!string.IsNullOrEmpty(_path))
                            {
                                _outputDirectory = _path;
                                s_changed        = true;
                            }
                        }
                    }

                    EditorGUI.indentLevel--;
                    if (EditorGUI.EndChangeCheck() || s_changed)
                    {
                        currentParams.outputDirectoryAuto    = _outputDirectoryAuto;
                        currentParams.outputUseConfiguration = _outputUseConfiguration;
                        currentParams.outputDirectory        = _outputDirectory;
                        s_changed = true;
                    }
                }
            }
        }
Example #16
0
        /// <summary>
        /// GUI Player Settingsの描画を行います
        /// </summary>
        public void DrawGUI_PlayerSettings()
        {
            var currentParams = P.GetCurrentParams();

            int  opt = currentParams.platformOption;
            bool fold;


            using (new GUILayout.VerticalScope(Styles.helpBox)) {
                using (new GUILayout.HorizontalScope()) {
                    EditorGUI.BeginChangeCheck();

                    fold = HEditorGUILayout.Foldout(E.i.fold.Has(E.FoldPlatform), "Player Settings");
                    E.i.fold.Toggle(E.FoldPlatform, fold);
                    if (EditorGUI.EndChangeCheck())
                    {
                        s_changed = true;
                    }

                    GUILayout.FlexibleSpace();

                    var r = EditorHelper.GetLayout(Styles.iconSettings, HEditorStyles.iconButton);

                    if (HEditorGUI.IconButton(r, Styles.iconSettings, 1))
                    {
                        if (PB.i.enableOldStyleProjectSettings)
                        {
                            Selection.activeObject = AssetDatabase.LoadAssetAtPath <UnityObject>(AssetDatabase.GUIDToAssetPath("00000000000000004000000000000000"));
                            EditorUtils.InspectorWindow().Focus();
                        }
                        else
                        {
                            UnityEditorMenu.Edit_Project_Settings();
                        }
                    }
                }

                EditorGUI.BeginChangeCheck();
                if (fold)
                {
                    EditorGUI.indentLevel++;

                    if (P.i.selectBuildTargetGroup == BuildTargetGroup.Standalone ||
                        P.i.selectBuildTargetGroup == BuildTargetGroup.Android)
                    {
                        currentParams.scriptingBackend = (ScriptingImplementation)EditorGUILayout.Popup(S._ScriptingBackend, (int)currentParams.scriptingBackend, B.kScriptingBackendNames);
                    }

                    bool backend = false;
                    if (P.i.selectBuildTargetGroup == BuildTargetGroup.WebGL)
                    {
                    }
                    else if (currentParams.scriptingBackend == ScriptingImplementation.Mono2x)
                    {
                        backend = true;
                    }
                    using (new EditorGUI.DisabledGroupScope(backend)) {
                        currentParams.il2CppCompilerConfiguration = (Il2CppCompilerConfiguration)EditorGUILayout.EnumPopup(S._C__CompilerConfiguration, currentParams.il2CppCompilerConfiguration);
                    }
                    EditorGUILayout.LabelField($"{S._ScriptingDefineSymbols} ({S._Applybuildonly})");


                    using (new GUILayout.HorizontalScope()) {
                        currentParams.scriptingDefineSymbols = EditorGUILayout.TextField(currentParams.scriptingDefineSymbols);
                        var mm = R.Method("GetSymbolList", "Hananoki.SymbolSettings.SettingsProject", "Hananoki.SymbolSettings.Editor");
                        if (mm != null)
                        {
                            var tc = GUILayoutUtility.GetRect(EditorHelper.TempContent(Styles.iconPlus), HEditorStyles.iconButton, GUILayout.Width(16), GUILayout.Height(16));

                            if (HEditorGUI.IconButton(tc, Styles.iconPlus, 3))
                            {
                                GUI.FocusControl("");
                                void add(object obj)
                                {
                                    var s  = obj as string;
                                    var ss = currentParams.scriptingDefineSymbols.Split(';');

                                    ArrayUtility.Add(ref ss, s);
                                    currentParams.scriptingDefineSymbols = string.Join(";", ss.Where(x => !x.IsEmpty()).Distinct().ToArray());
                                }

                                var hoge = (ValueTuple <string[], string[]>)mm.Invoke(null, null);
                                var lst  = new List <string>();
                                var m    = new GenericMenu();
                                foreach (var s in hoge.Item1)
                                {
                                    m.AddItem("Project/" + s, false, add, s);
                                }
                                foreach (var s in hoge.Item2)
                                {
                                    m.AddItem("Editor/" + s, false, add, s);
                                }
                                m.DropDown(tc);
                            }
                        }
                    }
                    EditorGUILayout.LabelField($"{S._ScriptingDefineSymbols} ({S._Current})");
                    EditorGUI.BeginDisabledGroup(true);
                    EditorGUILayout.TextField(B.scriptingDefineSymbols);
                    EditorGUI.EndDisabledGroup();

                    EditorGUI.indentLevel--;
                    GUILayout.Space(4);
                }
                if (EditorGUI.EndChangeCheck())
                {
                    currentParams.platformOption = opt;
                    s_changed = true;
                }
            }
        }
Example #17
0
        /// <summary>
        /// GUI Build Settingsの描画を行います
        /// </summary>
        public void DrawGUI_BuildSettings()
        {
            var currentParams = P.GetCurrentParams();

            EditorGUI.BeginChangeCheck();

            bool fold;

            using (new GUILayout.VerticalScope(Styles.helpBox)) {
                using (new GUILayout.HorizontalScope()) {
                    fold = HEditorGUILayout.Foldout(E.i.fold.Has(E.FoldBuildSettings), "Build Settings");
                    E.i.fold.Toggle(E.FoldBuildSettings, fold);
                    GUILayout.FlexibleSpace();
                    //EditorGUI.DrawRect( GUILayoutUtility.GetLastRect(), new Color( 0, 0, 1, 0.2f ) );

                    var r = EditorHelper.GetLayout(Styles.iconSettings, HEditorStyles.iconButton);
                    if (HEditorGUI.IconButton(r, Styles.iconSettings, B.kBuildSettings, 1))
                    {
                        UnityEditorMenu.File_Build_Settings();
                    }
                }

                if (fold)
                {
                    EditorGUI.indentLevel++;
                    currentParams.development = EditorGUILayout.Toggle(S._DevelopmentBuild, currentParams.development);

                    if (P.i.selectBuildTargetGroup == BuildTargetGroup.Android)
                    {
                        currentParams.buildAppBundle = EditorGUILayout.Toggle(S._BuildAppBundle_GooglePlay_, currentParams.buildAppBundle);
                    }

                    if (P.i.selectBuildTargetGroup == BuildTargetGroup.Standalone ||
                        P.i.selectBuildTargetGroup == BuildTargetGroup.Android)
                    {
                        string[] ss = { "Default", "LZ4", "LZ4HC" };
                        switch (EditorGUILayout.Popup(S._CompressionMethod, currentParams.compression.ToIndex(), ss, Styles.miniPopup))
                        {
                        case 0:
                            currentParams.compression = Compression.None;
                            break;

                        case 1:
                            currentParams.compression = Compression.Lz4;
                            break;

                        case 2:
                            currentParams.compression = Compression.Lz4HC;
                            break;
                        }
                    }

                    EditorGUI.indentLevel--;
                    GUILayout.Space(2);
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
                s_changed = true;
            }
        }
Example #18
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
        }
Example #19
0
        static void DrawContentConfig()
        {
            ScopeChange.Begin();

            //PB.i.enableAssetBundleBuild = HEditorGUILayout.ToggleLeft( S._EnableAssetBundleBuild, PB.i.enableAssetBundleBuild );
            //HEditorGUI.DrawDebugRectAtLastRect();
            PB.i.enableOldStyleProjectSettings = HEditorGUILayout.ToggleLeft(S._Usingtheold_styleProjectSettings, PB.i.enableOldStyleProjectSettings);
            GUILayout.Space(8);
            PB.i.enableExlusionAssets = HEditorGUILayout.ToggleLeft(S._Enablingassetexclusionatbuildtime, PB.i.enableExlusionAssets);

            GUILayout.Label(S._ExclusionAssetsList, EditorStyles.boldLabel);

            if (s_exclusionContents == null)
            {
                if (PB.i.exclusionAssets == null)
                {
                    PB.i.exclusionAssets = new List <PB.ExclusionSets>();
                }

                //foreach(var p in PB.i.exclusionAssets ) {
                //	Debug.Log( GUIDUtils.GetAssetPath( p.GUID ) );
                //}
                s_exclusionContents = PB.i.exclusionAssets.Select(x => x.GUID.ToAssetPath()).OrderBy(value => value).Select(x => new GUIContent(x, AssetDatabase.GetCachedIcon(x))).ToArray();
            }

            int removeIndex = -1;

            ScopeVertical.Begin(EditorStyles.helpBox);
            for (int i = 0; i < s_exclusionContents.Length; i++)
            {
                var s = s_exclusionContents[i];
                ScopeHorizontal.Begin();
                GUILayout.Label(EditorHelper.TempContent(""), GUILayout.ExpandWidth(true), GUILayout.Height(18));
                ScopeHorizontal.End();

                var rc = GUILayoutUtility.GetLastRect();
                GUI.Box(rc, "", Styles.projectBrowserHeaderBgMiddle);
                GUI.Label(rc, s, Styles.labelAndIcon);
                rc.x     = rc.xMax - 16;
                rc.width = 16;
                if (HEditorGUI.IconButton(rc, EditorIcon.minus))
                {
                    removeIndex = i;
                }
            }
            GUILayout.FlexibleSpace();
            if (0 <= removeIndex)
            {
                var findGUID = s_exclusionContents[removeIndex].text.ToGUID();
                var rIndex   = PB.i.exclusionAssets.FindIndex(x => x.GUID == findGUID);
                PB.i.exclusionAssets.RemoveAt(rIndex);
                s_exclusionContents = null;
                s_changed           = true;
            }
            ScopeVertical.End();

            var dropRc = GUILayoutUtility.GetLastRect();
            var evt    = Event.current;

            switch (evt.type)
            {
            case EventType.DragUpdated:
            case EventType.DragPerform:
                if (!dropRc.Contains(evt.mousePosition))
                {
                    break;
                }

                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;

                void AddFiles(params string[] paths)
                {
                    PB.i.exclusionAssets.AddRange(paths.Select(x => new PB.ExclusionSets(x.ToGUID(), x)).ToArray());
                    PB.i.exclusionAssets = PB.i.exclusionAssets.Distinct(x => x.GUID).ToList();
                    PB.Save();
                }

                string[] DirFiles(string path)
                {
                    return(DirectoryUtils.GetFiles(path, "*", SearchOption.AllDirectories).Where(x => x.Extension() != ".meta").ToArray());
                }

                if (evt.type == EventType.DragPerform)
                {
                    DragAndDrop.AcceptDrag();
                    if (DragAndDrop.paths.Length == 1)
                    {
                        if (Directory.Exists(DragAndDrop.paths[0]))
                        {
                            var m = new GenericMenu();
                            m.AddItem(S._Registerasafolder, false, (context) => {
                                AddFiles((string)context);
                            }, DragAndDrop.paths[0]);
                            m.AddItem(S._Registeringfilescontainedinafolder, false, (context) => {
                                AddFiles(DirFiles((string)context));
                                ;
                            }, DragAndDrop.paths[0]);
                            m.DropDownAtMousePosition();
                        }
                        else
                        {
                            AddFiles(DragAndDrop.paths);
                        }
                    }
                    else
                    {
                        bool dirChekc = false;
                        foreach (var s in DragAndDrop.paths)
                        {
                            if (Directory.Exists(s))
                            {
                                dirChekc = true;
                                break;
                            }
                        }
                        if (dirChekc)
                        {
                            var m = new GenericMenu();
                            m.AddItem(S._Registerasafolder, false, (context) => {
                                AddFiles((string[])context);
                            }, DragAndDrop.paths);
                            m.AddItem(S._Registeringfilescontainedinafolder, false, (context) => {
                                foreach (var s in ((string[])context))
                                {
                                    if (Directory.Exists(s))
                                    {
                                        AddFiles(DirFiles(s));
                                    }
                                    else
                                    {
                                        AddFiles(s);
                                    }
                                }
                            }, DragAndDrop.paths);
                            m.DropDownAtMousePosition();
                        }
                        else
                        {
                            AddFiles(DragAndDrop.paths);
                        }
                    }

                    DragAndDrop.activeControlID = 0;

                    s_exclusionContents = null;
                }
                s_changed = true;
                Event.current.Use();
                break;
            }

            if (ScopeChange.End())
            {
                s_changed = true;
            }
        }
Example #20
0
        public void SceneSelectTabOnGUI()
        {
            PB.Load();
            using (new VerticalScope(Styles.helpBox)) {
                using (new HorizontalScope()) {
                    void editButton()
                    {
                        var lsss = PrefixLabel(GUILayoutUtility.GetLastRect(), EditorHelper.TempContent(S._BuildSceneSet));

                        lsss.x    -= Styles.iconEdit.width;
                        lsss.x    -= 2;
                        lsss.width = Styles.iconEdit.width;

                        if (HEditorGUI.IconButton(lsss, Styles.iconEdit, 2))
                        {
                            editMode         = !editMode;
                            PB.i.profileList = PB.i.profileList.Distinct(a => a.profileName).ToList();

                            Repaint();
                        }
                    }

                    if (PB.i.profileList.Count <= PB.i.selectIndex)
                    {
                        PB.i.selectIndex = PB.i.profileList.Count - 1;
                    }

                    var lst = PB.i.profileList.Select(x => x.profileName).ToArray();

                    BeginChangeCheck();

                    if (editMode)
                    {
                        PB.i.selectProfile.profileName = EditorGUILayout.TextField(S._BuildSceneSet, PB.i.selectProfile.profileName);
                        editButton();
                    }
                    else
                    {
                        PB.i.selectIndex = EditorGUILayout.Popup(S._BuildSceneSet, PB.i.selectIndex, lst);

                        //var ls = GUILayoutUtility.GetLastRect();

                        editButton();

                        if (HEditorGUILayout.IconButton(Styles.iconPlus, 4))
                        {
                            PB.i.profileList.Add(new PB.Profile($"BuildScene ({PB.i.profileList.Count})"));
                            PB.i.selectIndex = PB.i.profileList.Count - 1;
                            s_changed        = true;
                        }
                        BeginDisabledGroup(PB.i.selectIndex == 0);
                        if (HEditorGUILayout.IconButton(Styles.iconMinus, 4))
                        {
                            PB.i.profileList.RemoveAt(PB.i.selectIndex);
                            PB.i.selectIndex = PB.i.profileList.Count - 1;
                            s_changed        = true;
                        }
                        EndDisabledGroup();
                    }

                    if (EndChangeCheck())
                    {
                        PB.Save();
                    }
                }
                BeginHorizontal();
                BeginChangeCheck();
                PB.i.selectProfile.exclusionScene = EditorGUILayout.ToggleLeft(S._ExcludescenesfromthebuildthatarenotregisteredinBuildSettings, PB.i.selectProfile.exclusionScene);
                if (Button(S._Checktheorderofthebuild, ExpandWidth(false)))
                {
                    var s = string.Join("\n", PB.GetBuildSceneName().Select((x, i) => $"{i}: {x}").ToArray());
                    EditorUtility.DisplayDialog(S._Checktheorderofthebuild, s, SS._OK);
                }
                if (EndChangeCheck())
                {
                    PB.Save();
                }

                EndHorizontal();
            }


            // Build SettingsにセットされているScene
            if (0 < m_scenePaths.Count)
            {
                Space(8);
                BeginHorizontal();
                Label(S._BuildSettingsScenes, Styles.boldLabel);
                var r = EditorHelper.GetLayout(Styles.iconSettings, HEditorStyles.iconButton);
                if (HEditorGUI.IconButton(r, Styles.iconSettings, B.kBuildSettings, 1))
                {
                    UnityEditorMenu.File_Build_Settings();
                }
                EndHorizontal();

                foreach (var p in m_scenePaths)
                {
                    BeginHorizontal(Styles.helpBox);
                    BeginDisabledGroup(true);
                    Toggle(p.enabled, "");
                    EndDisabledGroup();
                    Label(EditorHelper.TempContent(SceneName(p.path), EditorIcon.SceneAsset), Height(16));
                    if (EditorHelper.HasMouseClick(GUILayoutUtility.GetLastRect()))
                    {
                        EditorHelper.PingObject(p.path);
                        Event.current.Use();
                    }
                    FlexibleSpace();

                    foreach (var pp in PB.i.profileList)
                    {
                        BeginChangeCheck();
                        var toggle = Toggle(pp.Has(p.path), pp.profileName, "Button");
                        if (EndChangeCheck())
                        {
                            pp.Toggle(toggle, p.path);
                            PB.Save();
                        }
                    }
                    EndHorizontal();
                }
            }

            // Build SettingsにセットされていないScene
            Space(8);
            Label(S._ScenesotherthanBuildSettings, Styles.boldLabel);
            foreach (var scenePath in m_leakedScenes)
            {
                BeginHorizontal(Styles.helpBox);
                Space(20);
                Label(EditorHelper.TempContent(scenePath, EditorIcon.SceneAsset), Height(16));
                if (EditorHelper.HasMouseClick(GUILayoutUtility.GetLastRect()))
                {
                    EditorHelper.PingObject(scenePath);
                    Event.current.Use();
                }
                FlexibleSpace();
                foreach (var pp in PB.i.profileList)
                {
                    BeginChangeCheck();
                    var toggle = Toggle(pp.Has(scenePath), pp.profileName, "Button");
                    if (EndChangeCheck())
                    {
                        pp.Toggle(toggle, scenePath);
                        PB.Save();
                    }
                }
                EndHorizontal();
            }
        }
Example #21
0
        /// <summary>
        /// GUI 構成の描画を行います
        /// </summary>
        public void DrawGUI_ConfigurationSelect()
        {
            var currentParams = P.GetCurrentParams();

            using (new GUILayout.HorizontalScope()) {
                void editBUto()
                {
                    var lsss = EditorGUI.PrefixLabel(GUILayoutUtility.GetLastRect(), EditorHelper.TempContent(S._Configuration));

                    lsss.x    -= Styles.iconEdit.width;
                    lsss.x    -= 2;
                    lsss.width = Styles.iconEdit.width;

                    if (HEditorGUI.IconButton(lsss, Styles.iconEdit, 2))
                    {
                        editMode = !editMode;
                        Repaint();
                        Event.current.Use();
                    }
                }

                var lst = m_currentPlatform.parameters.Select(x => x.name).ToArray();

                if (editMode)
                {
                    currentParams.name = EditorGUILayout.TextField(S._Configuration, currentParams.name);
                    editBUto();
                }
                else
                {
                    EditorGUI.BeginChangeCheck();
                    P.i.selectParamsIndex = EditorGUILayout.Popup(S._Configuration, P.i.selectParamsIndex, lst);
                    if (EditorGUI.EndChangeCheck())
                    {
                        s_changed = true;
                    }

                    var ls = GUILayoutUtility.GetLastRect();

                    editBUto();

                    if (HEditorGUILayout.IconButton(Styles.iconPlus, 4))
                    {
                        m_currentPlatform.AddParams($"New ({m_currentPlatform.parameters.Count})");
                        P.i.selectParamsIndex = m_currentPlatform.parameters.Count - 1;
                        Event.current.Use();
                        s_changed = true;
                    }

                    if (HEditorGUILayout.IconButton(Styles.iconMinus, 4))
                    {
                        m_currentPlatform.parameters.RemoveAt(P.i.selectParamsIndex);
                        P.i.selectParamsIndex = m_currentPlatform.parameters.Count - 1;
                        Event.current.Use();
                        s_changed = true;
                    }
                }
            }


            EditorGUILayout.LabelField(S._BuildSceneSet, PB.i.GetSelectedPopupName(currentParams), EditorStyles.popup);
            var rrc = EditorGUI.PrefixLabel(GUILayoutUtility.GetLastRect(), S._BuildSceneSet.content());

            if (EditorHelper.HasMouseClick(rrc))
            {
                void OnSelect(object context)
                {
                    currentParams.buildSceneSetIndex = context.ToInt();
                    P.Save();
                }

                var m = new GenericMenu();
                m.AddItem(S._UsethestandardBuildSettings, false, OnSelect, -1);
                m.AddSeparator("");
                for (int idx = 0; idx < PB.i.profileList.Count; idx++)
                {
                    var p = PB.i.profileList[idx];
                    m.AddItem(p.profileName, false, OnSelect, idx);
                }
                m.DropDown(rrc);
                Event.current.Use();
            }
        }
Example #22
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);
        }
Example #23
0
        public void DrawGUI_AssetBundle()
        {
            if (!PB.i.enableAssetBundleBuild)
            {
                return;
            }

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

            EditorGUI.BeginChangeCheck();
            using (new GUILayout.VerticalScope(Styles.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(Styles.iconSettings, Styles.dropDownButton, GUILayout.Width(80), GUILayout.Height(16));

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


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

                    rc = HEditorGUI.lastRect;
                    GUI.Label(rc.AddH(-3), GUIContent.none, Styles.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;
                s_changed = true;
            }
        }