private static void OpenBuildSettings() { PlayInstantBuildSettingsWindow.ShowWindow(); }
private void OnDestroy() { _windowInstance = null; }
private void OnGUI() { // Edge case that takes place when the plugin code gets re-compiled while this window is open. if (_windowInstance == null) { _windowInstance = this; } var descriptionTextStyle = new GUIStyle(GUI.skin.label) { fontStyle = FontStyle.Italic, wordWrap = true }; EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Android Build Type", EditorStyles.boldLabel, GUILayout.Width(FieldWidth)); var index = EditorGUILayout.Popup(_isInstant ? 1 : 0, PlatformOptions); _isInstant = index == 1; EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); if (_isInstant) { var packageName = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.Android) ?? "package-name"; EditorGUILayout.LabelField( "Users can try instant apps in the Play Store by clicking the \"Try Now\" button. " + "Instant apps can also be launched using the following Launch API URL:", descriptionTextStyle); EditorGUILayout.SelectableLabel( string.Format("https://play.google.com/store/apps/details?id={0}&launch=true", packageName), descriptionTextStyle); } else { EditorGUILayout.LabelField( "The \"Installed\" build type is used when creating a traditional installable APK. " + "Select \"Instant\" to enable building a Google Play Instant APK or app bundle.", descriptionTextStyle); EditorGUILayout.Space(); EditorGUILayout.Space(); } // Disable the Save button unless one of the fields has changed. GUI.enabled = IsAnyFieldChanged(); if (GUILayout.Button("Save")) { if (_isInstant) { SelectPlatformInstant(); } else { SelectPlatformInstalled(); } } GUI.enabled = true; }
/// <summary> /// Displays this window, creating it if necessary. /// </summary> public static void ShowWindow() { _windowInstance = GetWindow <PlayInstantBuildSettingsWindow>(true, WindowTitle); _windowInstance.minSize = new Vector2(WindowMinWidth, WindowMinHeight); }