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
        /////////////////////////////////////////

        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();
        }
Ejemplo n.º 3
0
        public bool UIDraw(Rect rect, P.Params currentParams)
        {
            string[] ss    = { "Default", "LZ4", "LZ4HC" };
            var      index = currentParams.compression.ToIndex();

            ScopeChange.Begin();
            var _index = EditorGUI.Popup(rect, index, ss, Styles.miniPopup);

            if (ScopeChange.End())
            {
                switch (_index)
                {
                case 0:
                    currentParams.compression = Compression.None;
                    break;

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

                case 2:
                    currentParams.compression = Compression.Lz4HC;
                    break;
                }
                P.Save();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        /////////////////////////////////////////

        void DrawGUI()
        {
            Utils.s_changed = false;
            Utils.SelectItemUpdate();

            var w = position.width;
            var h = position.height;

            var drawArea = new Rect(0, EditorStyles.toolbar.fixedHeight, w, position.height - EditorStyles.toolbar.fixedHeight);

            using (new GUILayout.AreaScope(drawArea)) {
                if (P.i.selectScene)
                {
                    m_Drawer_ScenesInBuild.DrawGUI();
                    return;
                }
                else
                {
                    m_Drawer_BuildPlatforms.DrawGUI();
                }

                if (Utils.s_changed)
                {
                    P.Save();
                }
            }
        }
Ejemplo n.º 5
0
 public bool UIDraw(Rect rect, P.Params currentParams)
 {
     ScopeChange.Begin();
     currentParams.development = EditorGUI.Toggle(rect.W(16), currentParams.development);
     if (ScopeChange.End())
     {
         P.Save();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 6
0
        public static void DrawGUI()
        {
            P.Load();
            PB.Load();
            Styles.Init();

            DrawContentConfig();

            if (s_changed)
            {
                P.Save();
                PB.Save();
                BuildAssistWindow.Repaint();
            }
        }
Ejemplo n.º 7
0
 public bool UIDraw(Rect rect, P.Params currentParams)
 {
     ScopeChange.Begin();
     currentParams.WebGL_threadsSupport = EditorGUI.Toggle(rect.W(16), currentParams.WebGL_threadsSupport);
     if (HEditorGUI.IconButton(rect.AlignR(16).AddX(-4), EditorIcon._help))
     {
         EditorUtility.DisplayDialog(SS._Info, infoText, SS._OK);
     }
     if (ScopeChange.End())
     {
         P.Save();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 8
0
 public bool UIDraw(Rect rect, P.Params currentParams)
 {
     ScopeChange.Begin();
     currentParams.WebGL_exceptionSupport = (WebGLExceptionSupport)EditorGUI.EnumPopup(rect.TrimR(20), currentParams.WebGL_exceptionSupport);
     if (HEditorGUI.IconButton(rect.AlignR(16).AddX(-4), EditorIcon._help))
     {
         EditorUtility.DisplayDialog(SS._Info, infoText, SS._OK);
     }
     if (ScopeChange.End())
     {
         P.Save();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 9
0
        public bool UIDraw(Rect rect, P.Params currentParams)
        {
            int idx = ArrayUtility.IndexOf(m_memorySize, currentParams.WebGL_memorySize);

            if (idx < 0)
            {
                idx = 1;
            }
            ScopeChange.Begin();
            idx = EditorGUI.Popup(rect.TrimR(20), idx, m_memorySizePopup);

            if (ScopeChange.End())
            {
                currentParams.WebGL_memorySize = m_memorySize[idx];
                P.Save();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 10
0
        /////////////////////////////////////////

        public static void ChangeActiveTarget()
        {
            if (!P.GetPlatform(P.i.selectBuildTargetGroup).enable)
            {
                //int cur = (int)P.i.selectBuildTargetGroup;
                var  lst    = PlatformUtils.GetSupportList();
                int  cur    = lst.IndexOf(P.i.selectBuildTargetGroup);
                bool finded = false;
                int  idx    = cur - 1;
                while (0 <= idx)
                {
                    if (P.GetPlatform(lst[idx]).enable)
                    {
                        finded = true;
                        goto find;
                    }
                    idx--;
                }
                idx = cur + 1;
                while (idx < lst.Count)
                {
                    if (P.GetPlatform(lst[idx]).enable)
                    {
                        finded = true;
                        goto find;
                    }
                    idx++;
                }
find:
                if (finded)
                {
                    P.i.selectBuildTargetGroup = lst[idx];
                }
                else
                {
                    P.i.selectBuildTargetGroup = BuildTargetGroup.Unknown;
                }
                P.Save();
            }
            s_window.MakeDrawBuildTarget();
            Repaint();
        }
Ejemplo n.º 11
0
        public bool UIDraw(Rect rect, P.Params currentParams)
        {
            EditorGUI.LabelField(rect, PB.i.GetSelectedPopupName(currentParams), EditorStyles.popup);

            if (EditorHelper.HasMouseClick(rect))
            {
                void OnSelect(object context)
                {
                    currentParams.buildSceneSetIndex = (int)context;
                    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.DropDownPopupRect(rect);
            }
            return(false);
        }
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();
        }