private static void DrawPackagesSubPanel() { using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleGray1"))) { EditorGUILayout.LabelField("Packages are additional PlayFab features that can be installed. Enabling a package will install the AsssetPackage; disabling will remove the package.", PlayFabEditorHelper.uiStyle.GetStyle("genTxt")); } if (PlayFabEditorSDKTools.IsInstalled && PlayFabEditorSDKTools.isSdkSupported) { float labelWidth = 245; _packagesScrollPos = GUILayout.BeginScrollView(_packagesScrollPos, PlayFabEditorHelper.uiStyle.GetStyle("gpStyleGray1")); using (var fwl = new FixedWidthLabel("Push Notification Plugin (Android): ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorPackageManager.AndroidPushPlugin = EditorGUILayout.Toggle(PlayFabEditorPackageManager.AndroidPushPlugin, PlayFabEditorHelper.uiStyle.GetStyle("Toggle")); } GUILayout.Space(5); using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleClear"))) { if (GUILayout.Button("VIEW GUIDE", PlayFabEditorHelper.uiStyle.GetStyle("Button"))) { Application.OpenURL("https://github.com/PlayFab/UnitySDK/tree/master/PluginsSource/UnityAndroidPluginSource#playfab-push-notification-plugin"); } } GUILayout.EndScrollView(); } }
private static void DrawLogin() { float labelWidth = 120; using (new UnityVertical(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleGray1"))) { using (var fwl = new FixedWidthLabel("EMAIL: ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); _userEmail = EditorGUILayout.TextField(_userEmail, PlayFabEditorHelper.uiStyle.GetStyle("TextField"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("PASSWORD: "******"TextField"), GUILayout.MinHeight(25)); } using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("labelStyle"))) { if (GUILayout.Button("CREATE AN ACCOUNT", PlayFabEditorHelper.uiStyle.GetStyle("textButton"), GUILayout.MaxWidth(100))) { activeState = PanelDisplayStates.Register; } var buttonWidth = 100; GUILayout.Space(EditorGUIUtility.currentViewWidth - buttonWidth * 2); if (GUILayout.Button("LOG IN", PlayFabEditorHelper.uiStyle.GetStyle("Button"), GUILayout.MinHeight(32), GUILayout.MaxWidth(buttonWidth))) { OnLoginButtonClicked(); } } } }
private static void DrawApiSubPanel() { float labelWidth = 160; using (new UnityVertical(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleGray1"))) { using (var fwl = new FixedWidthLabel("ENABLE CLIENT API: ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorDataService.EnvDetails.isClientApiEnabled = EditorGUILayout.Toggle(PlayFabEditorDataService.EnvDetails.isClientApiEnabled, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("ENABLE ADMIN API: ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorDataService.EnvDetails.isAdminApiEnabled = EditorGUILayout.Toggle(PlayFabEditorDataService.EnvDetails.isAdminApiEnabled, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("ENABLE SERVER API: ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorDataService.EnvDetails.isServerApiEnabled = EditorGUILayout.Toggle(PlayFabEditorDataService.EnvDetails.isServerApiEnabled, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("ENABLE REQUEST TIMES: ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorDataService.EnvDetails.isDebugRequestTimesEnabled = EditorGUILayout.Toggle(PlayFabEditorDataService.EnvDetails.isDebugRequestTimesEnabled, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); } } }
private static void DrawPfSharedSettingsOptions(float labelWidth) { #if ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFABSERVER_API || UNITY_EDITOR // Set the title secret key, if we're using the dropdown var studio = GetStudioForTitleId(PlayFabEditorDataService.SharedSettings.TitleId); var correctKey = studio.GetTitleSecretKey(PlayFabEditorDataService.SharedSettings.TitleId); var setKey = !string.IsNullOrEmpty(studio.Id) && !string.IsNullOrEmpty(correctKey); if (setKey) { PlayFabEditorDataService.SharedSettings.DeveloperSecretKey = correctKey; } using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleClear"))) { EditorGUILayout.LabelField("DEVELOPER SECRET KEY: ", PlayFabEditorHelper.uiStyle.GetStyle("labelStyle"), GUILayout.Width(labelWidth)); using (new UnityGuiToggler(!setKey)) PlayFabEditorDataService.SharedSettings.DeveloperSecretKey = EditorGUILayout.TextField(PlayFabEditorDataService.SharedSettings.DeveloperSecretKey, PlayFabEditorHelper.uiStyle.GetStyle("TextField"), GUILayout.MinHeight(25)); } #endif using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleClear"))) { EditorGUILayout.LabelField("REQUEST TYPE: ", PlayFabEditorHelper.uiStyle.GetStyle("labelStyle"), GUILayout.MaxWidth(labelWidth)); PlayFabEditorDataService.SharedSettings.WebRequestType = (WebRequestType)EditorGUILayout.EnumPopup(PlayFabEditorDataService.SharedSettings.WebRequestType, PlayFabEditorHelper.uiStyle.GetStyle("TextField"), GUILayout.Height(25)); } if (PlayFabEditorDataService.SharedSettings.WebRequestType == WebRequestType.HttpWebRequest) { using (var fwl = new FixedWidthLabel(new GUIContent("REQUEST TIMEOUT: "), PlayFabEditorHelper.uiStyle.GetStyle("labelStyle"))) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorDataService.SharedSettings.TimeOut = EditorGUILayout.IntField(PlayFabEditorDataService.SharedSettings.TimeOut, PlayFabEditorHelper.uiStyle.GetStyle("TextField"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel(new GUIContent("KEEP ALIVE: "), PlayFabEditorHelper.uiStyle.GetStyle("labelStyle"))) { GUILayout.Space(labelWidth - fwl.fieldWidth); PlayFabEditorDataService.SharedSettings.KeepAlive = EditorGUILayout.Toggle(PlayFabEditorDataService.SharedSettings.KeepAlive, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); } } using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleClear"))) { EditorGUILayout.LabelField("COMPRESS API DATA: ", PlayFabEditorHelper.uiStyle.GetStyle("labelStyle"), GUILayout.MaxWidth(labelWidth)); PlayFabEditorDataService.SharedSettings.CompressApiData = EditorGUILayout.Toggle(PlayFabEditorDataService.SharedSettings.CompressApiData, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); } }
private static void DrawRegister() { float labelWidth = 150; using (new UnityVertical(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleGray1"))) { using (var fwl = new FixedWidthLabel("EMAIL:")) { GUILayout.Space(labelWidth - fwl.fieldWidth); _userEmail = EditorGUILayout.TextField(_userEmail, PlayFabEditorHelper.uiStyle.GetStyle("TextField"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("PASSWORD:"******"TextField"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("CONFIRM PASSWORD: "******"TextField"), GUILayout.MinHeight(25)); } using (var fwl = new FixedWidthLabel("STUDIO NAME: ")) { GUILayout.Space(labelWidth - fwl.fieldWidth); _studio = EditorGUILayout.TextField(_studio, PlayFabEditorHelper.uiStyle.GetStyle("TextField"), GUILayout.MinHeight(25)); } using (new UnityHorizontal(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleClear"))) { if (GUILayout.Button("LOG IN", PlayFabEditorHelper.uiStyle.GetStyle("textButton"), GUILayout.MinHeight(32))) { activeState = PanelDisplayStates.Login; } GUILayout.FlexibleSpace(); if (GUILayout.Button(" CREATE AN ACCOUNT ", PlayFabEditorHelper.uiStyle.GetStyle("Button"), GUILayout.MinHeight(32))) { OnRegisterClicked(); } } } }
private static void DrawApiSubPanel() { using (new UnityVertical(PlayFabEditorHelper.uiStyle.GetStyle("gpStyleGray1"))) { var curDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); var changedFlags = false; var allFlags = new Dictionary <string, PfDefineFlag>(PlayFabEditorHelper.FLAG_LABELS); var extraDefines = new HashSet <string>(curDefines.Split(' ', ';')); foreach (var eachFlag in extraDefines) { if (!string.IsNullOrEmpty(eachFlag) && !allFlags.ContainsKey(eachFlag)) { allFlags.Add(eachFlag, new PfDefineFlag { Flag = eachFlag, Label = eachFlag, Category = PfDefineFlag.FlagCategory.Other, isInverted = false, isSafe = false }); } } var allowUnsafe = extraDefines.Contains(PlayFabEditorHelper.ENABLE_BETA_FETURES); foreach (PfDefineFlag.FlagCategory activeFlagCategory in Enum.GetValues(typeof(PfDefineFlag.FlagCategory))) { if (activeFlagCategory == PfDefineFlag.FlagCategory.Other && !allowUnsafe) { continue; } using (var fwl = new FixedWidthLabel(activeFlagCategory.ToString())) { } foreach (var eachDefinePair in allFlags) { PfDefineFlag eachFlag = eachDefinePair.Value; if (eachFlag.Category == activeFlagCategory && (eachFlag.isSafe || allowUnsafe)) { DisplayDefineToggle(eachFlag.Label + ": ", eachFlag.isInverted, eachFlag.Flag, ref curDefines, ref changedFlags); } } } if (changedFlags) { PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, curDefines); Debug.Log("Updating Defines: " + curDefines); AssetDatabase.Refresh(); } } }
private static void DisplayDefineToggle(string label, bool invertDisplay, string displayedDefine, ref string curDefines, ref bool changedFlag) { bool flagSet, flagGet = curDefines.Contains(displayedDefine); using (var fwl = new FixedWidthLabel(label)) { GUILayout.Space(LABEL_WIDTH - fwl.fieldWidth); flagSet = EditorGUILayout.Toggle(invertDisplay ? !flagGet : flagGet, PlayFabEditorHelper.uiStyle.GetStyle("Toggle"), GUILayout.MinHeight(25)); if (invertDisplay) { flagSet = !flagSet; } } changedFlag |= flagSet != flagGet; Sb.Length = 0; if (flagSet && !flagGet) { Sb.Append(curDefines); if (Sb.Length > 0) { Sb.Append(";"); } Sb.Append(displayedDefine); curDefines = Sb.ToString(); } else if (!flagSet && flagGet) { Sb.Append(curDefines); Sb.Replace(displayedDefine, "").Replace(";;", ";"); if (Sb.Length > 0 && Sb[0] == ';') { Sb.Remove(0, 1); } if (Sb.Length > 0 && Sb[Sb.Length - 1] == ';') { Sb.Remove(Sb.Length - 1, 1); } curDefines = Sb.ToString(); } }