private void OnGuiDeployBundleSelect()
        {
            //TODO: investigate sharing this code
            var descriptionTextStyle = CreateDescriptionTextStyle();

            EditorGUILayout.LabelField("Create Google Cloud Credentials", EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical(UserInputGuiStyle);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField(
                "Quick Deploy requires valid credentials to upload the AssetBundle file.",
                descriptionTextStyle);
            EditorGUILayout.LabelField(
                "Open Google Cloud console to create an OAuth 2.0 client ID. Select Application Type \"Other\". " +
                "Download the JSON file containing the credentials.",
                descriptionTextStyle);
            EditorGUILayout.Space();

            if (GUILayout.Button("Open Google Cloud Console"))
            {
                Application.OpenURL("https://console.cloud.google.com/apis/credentials");
            }

            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Configure AssetBundle Deployment", EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical(UserInputGuiStyle);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField(
                "Specify path to credentials file created above and to AssetBundle file created with  " +
                "AssetBundle Browser. Choose bucket and object names to use for uploaded AssetBundle file.",
                descriptionTextStyle);
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Google Cloud Credentials File Path", GUILayout.MinWidth(FieldMinWidth));
            Config.CloudCredentialsFileName =
                EditorGUILayout.TextField(Config.CloudCredentialsFileName,
                                          GUILayout.MinWidth(FieldMinWidth));
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Browse", GUILayout.Width(ShortButtonWidth)))
            {
                Config.CloudCredentialsFileName =
                    EditorUtility.OpenFilePanel("Select cloud credentials file", "", "");
                HandleDialogExit();
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("AssetBundle File Path", GUILayout.MinWidth(FieldMinWidth));
            Config.AssetBundleFileName = EditorGUILayout.TextField(Config.AssetBundleFileName,
                                                                   GUILayout.MinWidth(FieldMinWidth));
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Browse", GUILayout.Width(ShortButtonWidth)))
            {
                Config.AssetBundleFileName = EditorUtility.OpenFilePanel("Select AssetBundle file", "", "");
                HandleDialogExit();
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Cloud Storage Bucket Name", GUILayout.MinWidth(FieldMinWidth));
            Config.CloudStorageBucketName =
                EditorGUILayout.TextField(Config.CloudStorageBucketName, GUILayout.MinWidth(FieldMinWidth));
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Cloud Storage Object Name", GUILayout.MinWidth(FieldMinWidth));
            Config.CloudStorageObjectName =
                EditorGUILayout.TextField(Config.CloudStorageObjectName, GUILayout.MinWidth(FieldMinWidth));
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            EditorGUILayout.Space();
            if (GUILayout.Button("Upload to Google Cloud Storage"))
            {
                try
                {
                    Config.SaveConfiguration(ToolBarSelectedButton.DeployBundle);
                    GcpClient.DeployConfiguredFile();
                }
                catch (Exception ex)
                {
                    DialogHelper.DisplayMessage(AssetBundleDeploymentErrorTitle, ex.Message);

                    throw;
                }
            }

            EditorGUILayout.Space();

            EditorGUILayout.EndVertical();
        }
        private void OnGuiLoadingScreenSelect()
        {
            var descriptionTextStyle = CreateDescriptionTextStyle();

            EditorGUILayout.LabelField("Set AssetBundle URL", EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical(UserInputGuiStyle);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField(
                "Specify the URL that points to the deployed AssetBundle. The AssetBundle will be downloaded at game startup. ",
                descriptionTextStyle);
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("AssetBundle URL", GUILayout.MinWidth(FieldMinWidth));
            Config.AssetBundleUrl =
                EditorGUILayout.TextField(Config.AssetBundleUrl, GUILayout.MinWidth(FieldMinWidth));
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            var setAssetBundleText = QuickDeployConfig.EngineConfigExists()
                ? "Update AssetBundle URL"
                : "Set AssetBundle URL";

            if (GUILayout.Button(setAssetBundleText))
            {
                try
                {
                    Config.SaveConfiguration(ToolBarSelectedButton.LoadingScreen);
                }
                catch (Exception ex)
                {
                    DialogHelper.DisplayMessage(AssetBundleCheckerErrorTitle, ex.Message);

                    throw;
                }
            }

            EditorGUILayout.Space();
            if (GUILayout.Button("Check AssetBundle"))
            {
                var window = AssetBundleVerifierWindow.ShowWindow();

                try
                {
                    Config.SaveConfiguration(ToolBarSelectedButton.LoadingScreen);
                    window.StartAssetBundleDownload(Config.AssetBundleUrl);
                }
                catch (Exception ex)
                {
                    DialogHelper.DisplayMessage(AssetBundleCheckerErrorTitle, ex.Message);

                    window.Close();

                    throw;
                }
            }

            EditorGUILayout.Space();

            EditorGUILayout.EndVertical();
            EditorGUILayout.Space();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Select Loading Screen Image", EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical(UserInputGuiStyle);
            EditorGUILayout.Space();

            EditorGUILayout.LabelField(
                "Choose image to use as background for the loading scene.", descriptionTextStyle);
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Image File Path", GUILayout.MinWidth(FieldMinWidth));

            _loadingScreenImagePath =
                EditorGUILayout.TextField(_loadingScreenImagePath, GUILayout.MinWidth(FieldMinWidth));

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Browse", GUILayout.Width(ShortButtonWidth)))
            {
                _loadingScreenImagePath =
                    EditorUtility.OpenFilePanel("Select Image", "", "png,jpg,jpeg,tif,tiff,gif,bmp");
                HandleDialogExit();
            }

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            if (LoadingScreenGenerator.LoadingScreenExists())
            {
                if (GUILayout.Button("Update Loading Scene"))
                {
                    try
                    {
                        Config.SaveConfiguration(ToolBarSelectedButton.LoadingScreen);
                        LoadingScreenGenerator.AddImageToScene(LoadingScreenGenerator.GetLoadingScreenCanvasObject(),
                                                               _loadingScreenImagePath);
                    }
                    catch (Exception ex)
                    {
                        DialogHelper.DisplayMessage(LoadingScreenUpdateErrorTitle, ex.Message);
                        throw;
                    }
                }
            }
            else
            {
                if (GUILayout.Button("Create Loading Scene"))
                {
                    try
                    {
                        Config.SaveConfiguration(ToolBarSelectedButton.LoadingScreen);
                        LoadingScreenGenerator.GenerateScene(Config.AssetBundleUrl,
                                                             _loadingScreenImagePath);
                    }
                    catch (Exception ex)
                    {
                        DialogHelper.DisplayMessage(LoadingScreenCreationErrorTitle, ex.Message);
                        throw;
                    }
                }
            }

            EditorGUILayout.Space();

            EditorGUILayout.EndVertical();
        }
        private void OnGuiCreateBundleSelect()
        {
            var descriptionTextStyle = CreateDescriptionTextStyle();

            EditorGUILayout.LabelField("Create AssetBundle", EditorStyles.boldLabel);

            EditorGUILayout.BeginVertical(UserInputGuiStyle);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Select scenes to be put into an AssetBundle and then build it.",
                                       descriptionTextStyle);

            EditorGUILayout.Space();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical(UserInputGuiStyle);
            EditorGUILayout.Space();

            _playInstantSceneTreeTreeView.OnGUI(GUILayoutUtility.GetRect(position.width,
                                                                         position.height - SceneViewDeltaFromTop));
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Add Open Scenes"))
            {
                _playInstantSceneTreeTreeView.AddOpenScenes();
            }

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            EditorGUILayout.Space();


            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("AssetBundle File Path", GUILayout.MinWidth(FieldMinWidth));
            Config.AssetBundleFileName = EditorGUILayout.TextField(Config.AssetBundleFileName,
                                                                   GUILayout.MinWidth(FieldMinWidth));
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Browse", GUILayout.Width(ShortButtonWidth)))
            {
                Config.AssetBundleFileName = EditorUtility.SaveFilePanel("Save AssetBundle", "", "", "");
                HandleDialogExit();
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("Build AssetBundle"))
            {
                try
                {
                    Config.SaveConfiguration(ToolBarSelectedButton.CreateBundle);
                    AssetBundleBuilder.BuildQuickDeployAssetBundle(GetEnabledSceneItemPaths());
                }
                catch (Exception ex)
                {
                    DialogHelper.DisplayMessage(AssetBundleBuildErrorTitle,
                                                ex.Message);
                    throw;
                }

                HandleDialogExit();
            }

            EditorGUILayout.EndHorizontal();
        }