///////////////////////////////////////// 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; } }
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); }
public bool UIDraw(Rect rect, P.Params currentParams) { //if( !HEditorGUI.IconButton( rect.W( 16 ), EditorIcon.settings ) ) return false; //UnityEditorMenu.File_Build_Settings(); return(false); }
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); }
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); }
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); }
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); }
public bool UIDraw(Rect rect, P.Params currentParams) { if (!HEditorGUI.IconButton(rect.W(16), EditorIcon.settings)) { return(false); } if (PB.i.enableOldStyleProjectSettings) { Selection.activeObject = AssetDatabase.LoadAssetAtPath <UnityObject>(AssetDatabase.GUIDToAssetPath("00000000000000004000000000000000")); EditorWindowUtils.Find(UnityTypes.UnityEditor_InspectorWindow)?.Focus(); } else { //UnityEditorMenu.Edit_Project_Settings(); UnityEditorSettingsWindow.Show(SettingsScope.Project, "Project/Player"); } return(false); }
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); }
public bool isDisable(P.Params currentParams) => !UnitySymbol.Has("UNITY_2019_1_OR_NEWER");
public bool isDisable(P.Params currentParams) => false;
void DrawGUI_Android(P.Params currentParams) { int opt = currentParams.platformOption; //bool fold; //using( new GUILayout.VerticalScope( s_styles.HelpBox ) ) { // using( new GUILayout.HorizontalScope() ) { // EditorGUI.BeginChangeCheck(); // fold = EditorGUILayout.Foldout( BuildManagerSettingsEditor.i.fold.Has( BuildManagerSettingsEditor.FoldPlatform ), "Player Settings", s_styles.Foldout ); // BuildManagerSettingsEditor.i.fold.Toggle( BuildManagerSettingsEditor.FoldPlatform, fold ); // if( EditorGUI.EndChangeCheck() ) s_changed = true; // GUILayout.FlexibleSpace(); // var r = GUILayoutUtility.GetRect( 20, 18 ); // GUI.Label( r, s_styles.Settings, s_styles.Icon ); // if( EditorHelper.HasMouseClick( GUILayoutUtility.GetLastRect() ) ) { // Selection.activeObject = AssetDatabase.LoadAssetAtPath<UnityObject>( AssetDatabase.GUIDToAssetPath( "00000000000000004000000000000000" ) ); // EditorUtils.InspectorWindow().Focus(); // Event.current.Use(); // } // } // EditorGUI.BeginChangeCheck(); // if( fold ) { // EditorGUI.indentLevel++; // currentParams.scriptingBackend = (ScriptingImplementation) EditorGUILayout.Popup( L.Tr( "ScriptingBackend" ), (int) currentParams.scriptingBackend, s_scriptingBackend ); // using( new EditorGUI.DisabledGroupScope( currentParams.scriptingBackend == ScriptingImplementation.Mono2x ) ) { // currentParams.il2CppCompilerConfiguration = (Il2CppCompilerConfiguration) EditorGUILayout.EnumPopup( L.Tr( "C++ Compiler Configuration" ), currentParams.il2CppCompilerConfiguration ); // } // EditorGUILayout.LabelField( $"{L.Tr( "Scripting Define Symbols" )} ({L.Tr( "Additional" )})" ); // currentParams.scriptingDefineSymbols = EditorGUILayout.TextField( currentParams.scriptingDefineSymbols ); // EditorGUILayout.LabelField( $"{L.Tr( "Scripting Define Symbols" )} ({L.Tr( "Current" )})" ); // EditorGUI.BeginDisabledGroup( true ); // EditorGUILayout.TextField( B.scriptingDefineSymbols ); // EditorGUI.EndDisabledGroup(); // EditorGUI.indentLevel--; // GUILayout.Space( 4 ); // } // if( EditorGUI.EndChangeCheck() ) { // currentParams.platformOption = opt; // s_changed = true; // } //} GUILayout.Space(4); DrawGUI_3rdpartySettings(); #if false //保留 currentParams.DEBUG_LOG = EGL.Toggle("DEBUG_LOG", currentParams.DEBUG_LOG); BuildManagerPreference.i.adb_exe = EGL.TextField("adb.exe", BuildManagerPreference.i.adb_exe); BuildManagerPreference.i.bundletool_jar = EGL.TextField("bundletool", BuildManagerPreference.i.bundletool_jar); using (new GL.HorizontalScope()) { GL.FlexibleSpace(); GL.Button("Install on device"); GL.Button("Launch on device"); } #endif GUILayout.Space(4); EditorGUI.BeginChangeCheck(); using (new GUILayout.HorizontalScope()) { GUILayout.Label($"Version", EditorStyles.label); GUILayout.Label($"{PlayerSettings.bundleVersion}", EditorStyles.label); var a = GUILayoutUtility.GetLastRect(); a.x += a.width; a.width = 8; a.height = 8; //a.x -= 6; var rcU = a; rcU.y -= 0; var rcD = a; rcD.y += 0 + a.height; if (GUI.Button(rcU, EditorIcon.allowUp, Styles.icon)) { var f = float.Parse(PlayerSettings.bundleVersion); int i = (int)((f * 100.0f + 0.5f)); i += 100; f = i / 100.0f; PlayerSettings.bundleVersion = f.ToString("F2"); } if (GUI.Button(rcD, EditorIcon.allowUp, Styles.icon)) { var f = float.Parse(PlayerSettings.bundleVersion); int i = (int)((f * 100.0f + 0.5f)); i -= 100; f = i / 100.0f; PlayerSettings.bundleVersion = f.ToString("F2"); } rcU.x += 8; rcD.x += 8; if (GUI.Button(rcU, EditorIcon.allowUp, Styles.icon)) { var f = float.Parse(PlayerSettings.bundleVersion); int i = (int)((f * 100.0f + 0.5f)); i++; f = i / 100.0f; PlayerSettings.bundleVersion = f.ToString("F2"); } if (GUI.Button(rcD, EditorIcon.allowUp, Styles.icon)) { var f = float.Parse(PlayerSettings.bundleVersion); int i = (int)((f * 100.0f + 0.5f)); i--; f = i / 100.0f; PlayerSettings.bundleVersion = f.ToString("F2"); } GUILayout.Space(20); GUILayout.Label($"Bundle Version Code", EditorStyles.label); GUILayout.Label($"{PlayerSettings.Android.bundleVersionCode}", EditorStyles.label); a = GUILayoutUtility.GetLastRect(); a.x += a.width; a.width = 8; a.height = 8; rcU = a; rcU.y -= 0; rcD = a; rcD.y += 0 + a.height; if (GUI.Button(rcU, EditorIcon.allowUp, Styles.icon)) { PlayerSettings.Android.bundleVersionCode++; } if (GUI.Button(rcD, EditorIcon.allowUp, Styles.icon)) { PlayerSettings.Android.bundleVersionCode--; } GUILayout.FlexibleSpace(); } if (EditorGUI.EndChangeCheck()) { Utils.s_changed = true; } 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(S._PlayerSettings_Androidsettingsareincomplete, "console.erroricon.sml"); once = true; } if (PlayerSettings.Android.bundleVersionCode == 0) { errorTitle(); errorLabel(S._IfBundleVersionCodeis0_abuilderroroccurs); } if (B.applicationIdentifier.IsEmpty()) { errorTitle(); errorLabel(S._PackageNameofIdentificationisempty); } else if (B.applicationIdentifier == "com.Company.ProductName") { errorTitle(); errorLabel(S._AnerroroccursifPackageNameis_com_Company_ProductName_); } else if (!B.applicationIdentifier.Contains(".")) { errorTitle(); errorLabel(S._PackageNamemustbeseparatedbyatleastone__Dot_); } else if (B.applicationIdentifier[0] == '.') { errorTitle(); errorLabel(S._AnerroroccursifPackageNamestartswitha__Dot_); } else if (B.applicationIdentifier[B.applicationIdentifier.Length - 1] == '.') { errorTitle(); errorLabel(S._AnerroroccursiftheendofPackageNameis__Dot_); } }