public static void BeginCloudScriptUpload()
        {
            string filePath = File.Exists(PlayFabEditorDataService.envDetails.localCloudScriptPath) ? PlayFabEditorDataService.envDetails.localCloudScriptPath : PlayFabEditorHelper.CLOUDSCRIPT_PATH;

            if (!File.Exists(PlayFabEditorDataService.envDetails.localCloudScriptPath) && !File.Exists(PlayFabEditorHelper.CLOUDSCRIPT_PATH))
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, "Cloud Script Upload Failed: null or corrupt file at path(" + filePath + ").");
                return;
            }

            StreamReader s        = File.OpenText(filePath);
            string       contents = s.ReadToEnd();

            s.Close();

            UpdateCloudScriptRequest request = new UpdateCloudScriptRequest();

            request.Publish = EditorUtility.DisplayDialog("Deployment Options", "Do you want to make this Cloud Script live after uploading?", "Yes", "No");
            request.Files   = new List <CloudScriptFile>()
            {
                new CloudScriptFile()
                {
                    Filename     = PlayFabEditorHelper.CLOUDSCRIPT_FILENAME,
                    FileContents = contents
                }
            };

            PlayFabEditorApi.UpdateCloudScript(request, (UpdateCloudScriptResult result) => {
                PlayFabEditorDataService.envDetails.localCloudScriptPath = filePath;
                PlayFabEditorDataService.SaveEnvDetails();

                Debug.Log("CloudScript uploaded successfully!");
            }, PlayFabEditorHelper.SharedErrorCallback);
        }
 public void OnDestroy()
 {
     if (PlayFabEditor.IsEventHandlerRegistered(StateUpdateHandler))
     {
         PlayFabEditor.EdExStateUpdate -= StateUpdateHandler;
     }
 }
 //CTOR
 static PlayFabEditorSettings()
 {
     if (!PlayFabEditor.IsEventHandlerRegistered(StateUpdateHandler))
     {
         PlayFabEditor.EdExStateUpdate += StateUpdateHandler;
     }
 }
Exemplo n.º 4
0
        public static void Logout()
        {
            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogout);

            PlayFabEditorApi.Logout(new LogoutRequest()
            {
                DeveloperClientToken = PlayFabEditorDataService.accountDetails.devToken
            }, null, PlayFabEditorHelper.SharedErrorCallback);

            _userPass = string.Empty;

            _userPass2 = string.Empty;


            activeState = PanelDisplayStates.Login;

            PlayFabEditorDataService.accountDetails.studios.Clear();

            PlayFabEditorDataService.accountDetails.devToken = string.Empty;

            PlayFabEditorDataService.SaveAccountDetails();

            PlayFabEditorDataService.envDetails.titleData.Clear();
            PlayFabEditorDataService.SaveEnvDetails();
        }
Exemplo n.º 5
0
        internal static void MakeDownloadCall(string url, Action <string> resultCallback)
        {
            var www = new WWW(url);

            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnHttpReq, url, PlayFabEditorHelper.MSG_SPIN_BLOCK);
            EditorCoroutine.start(PostDownload(www, (response) =>
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnHttpRes, url);

                var fileName = string.Empty;
                if (url.IndexOf("unity-edex") > -1)
                {
                    fileName = PlayFabEditorHelper.EDEX_DOWNLOAD_PATH;
                }
                else if (url.IndexOf("unity-via-edex") > -1)
                {
                    fileName = PlayFabEditorHelper.SDK_DOWNLOAD_PATH;
                }


                string fileSaveLocation = string.Format(PlayFabEditorHelper.EDITOR_ROOT + fileName);
                System.IO.File.WriteAllBytes(fileSaveLocation, response);
                resultCallback(fileSaveLocation);
            }, PlayFabEditorHelper.SharedErrorCallback), www);
        }
Exemplo n.º 6
0
        private static void OnRegisterClicked()
        {
            if (_userPass != _userPass2)
            {
                Debug.LogError("PlayFab developer account passwords must match.");
                return;
            }


            PlayFabEditorApi.RegisterAccouint(new RegisterAccountRequest()
            {
                DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
                DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
                Email      = _userEmail,
                Password   = _userPass,
                StudioName = _studio
            }, (result) =>
            {
                PlayFabEditorDataService.accountDetails.devToken = result.DeveloperClientToken;
                PlayFabEditorDataService.accountDetails.email    = _userEmail;

                PlayFabEditorApi.GetStudios(new GetStudiosRequest(), (getStudioResult) =>
                {
                    PlayFabEditorDataService.accountDetails.studios = getStudioResult.Studios.ToList();
                    PlayFabEditorDataService.SaveAccountDetails();
                }, PlayFabEditorHelper.SharedErrorCallback);

                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
                PlayFabEditorDataService.SaveAccountDetails();
                PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
            }, PlayFabEditorHelper.SharedErrorCallback);
        }
Exemplo n.º 7
0
 public SubMenuComponent()
 {
     if (!PlayFabEditor.IsEventHandlerRegistered(StateUpdateHandler))
     {
         PlayFabEditor.EdExStateUpdate += StateUpdateHandler;
     }
 }
Exemplo n.º 8
0
        private static void OnContinueButtonClicked()
        {
            PlayFabEditorApi.Login(new LoginRequest()
            {
                DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
                DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
                TwoFactorAuth = _2faCode,
                Email         = _userEmail,
                Password      = _userPass
            }, (result) =>
            {
                PlayFabEditorDataService.accountDetails.devToken = result.DeveloperClientToken;
                PlayFabEditorDataService.accountDetails.email    = _userEmail;


                PlayFabEditorApi.GetStudios(new GetStudiosRequest(), (getStudioResult) =>
                {
                    PlayFabEditorDataService.accountDetails.studios = getStudioResult.Studios.ToList();
                    PlayFabEditorDataService.SaveAccountDetails();
                }, PlayFabEditorHelper.SharedErrorCallback);

                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
                PlayFabEditorDataService.SaveAccountDetails();
                PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
            }, PlayFabEditorHelper.SharedErrorCallback);
        }
Exemplo n.º 9
0
        public static void OnSettingsClicked()
        {
            _menuState = MenuStates.Settings;

            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnMenuItemClicked, MenuStates.Settings.ToString());
            PlayFabEditorDataService.editorSettings.currentMainMenu = (int)MenuStates.Settings;
            PlayFabEditorDataService.SaveEditorSettings();
        }
        static PlayFabEditorDataMenu()
        {
            if (!PlayFabEditor.IsEventHandlerRegistered(StateUpdateHandler))
            {
                PlayFabEditor.EdExStateUpdate += StateUpdateHandler;
            }

            RegisterMenu();
        }
        private static void OnSaveSettings()
        {
            // make assessments on the override at studio positon 0
            if (PlayFabEditorSDKTools.IsInstalled && PlayFabEditorSDKTools.isSdkSupported)
            {
                if (_foundUnknownTitleId || _selectedStudioIndex == 0)
                {
                    if (PlayFabEditorDataService.envDetails.selectedTitleId != _TitleId)
                    {
                        PlayFabEditorDataService.envDetails.titleData.Clear();
                        if (PlayFabEditorDataMenu.tdViewer != null)
                        {
                            PlayFabEditorDataMenu.tdViewer.items.Clear();
                        }
                    }

                    PlayFabEditorDataService.envDetails.selectedTitleId = _TitleId;
                }
                else
                {
                    // if we switched titles clear titledata
                    if (PlayFabEditorDataService.envDetails.selectedTitleId != GetSelectedTitleIdFromOptions())
                    {
                        PlayFabEditorDataService.envDetails.titleData.Clear();
                        if (PlayFabEditorDataMenu.tdViewer != null)
                        {
                            PlayFabEditorDataMenu.tdViewer.items.Clear();
                        }
                    }

                    PlayFabEditorDataService.envDetails.selectedTitleId = GetSelectedTitleIdFromOptions();
                }


                PlayFabEditorDataService.envDetails.selectedStudio = studioOptions[_selectedStudioIndex];


                #if ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFABSERVER_API
                PlayFabEditorDataService.envDetails.developerSecretKey = _DeveloperSecretKey;
                #endif

                PlayFabEditorDataService.envDetails.compressApiData = _CompressApiData;
                PlayFabEditorDataService.envDetails.keepAlive       = _KeepAlive;
                PlayFabEditorDataService.envDetails.webRequestType  = _RequestType;
                PlayFabEditorDataService.envDetails.timeOut         = _RequestTimeOut;

                PlayFabEditorDataService.SaveEnvDetails();

                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnSuccess);
            }
            else
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, "SDK is unsupported or not installed");
            }
        }
        public static void LoadAllData()
        {
            LoadAccountDetails();
            LoadEnvDetails();
            LoadEditorSettings();

            LoadFromScriptableObject();

            isDataLoaded = true;
            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnDataLoaded, "Complete");
        }
 public static void SaveAccountDetails()
 {
     try
     {
         var serialized = Json.JsonWrapper.SerializeObject(accountDetails);
         EditorPrefs.SetString(keyPrefix + "PlayFab_DeveloperAccountDetails", serialized);
     }
     catch (Exception ex)
     {
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
     }
 }
 public static void SaveEditorSettings()
 {
     try
     {
         var serialized = Json.JsonWrapper.SerializeObject(editorSettings);
         EditorPrefs.SetString(keyPrefix + "PlayFab_EditorSettings", serialized);
     }
     catch (Exception ex)
     {
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
     }
 }
Exemplo n.º 15
0
        static void PlayFabServices()
        {
            var editorAsm   = typeof(UnityEditor.Editor).Assembly;
            var inspWndType = editorAsm.GetType("UnityEditor.SceneHierarchyWindow");

            if (inspWndType == null)
            {
                inspWndType = editorAsm.GetType("UnityEditor.InspectorWindow");
            }

            window = EditorWindow.GetWindow <PlayFabEditor>(inspWndType);
            window.titleContent = new GUIContent("PlayFab EdEx");
        }
Exemplo n.º 16
0
        public static void OnLogoutClicked()
        {
            _menuState = MenuStates.Logout;

            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnMenuItemClicked, MenuStates.Logout.ToString());

            PlayFabEditorAuthenticate.Logout();


            _menuState = MenuStates.Sdks;

            PlayFabEditorDataService.editorSettings.currentMainMenu = (int)MenuStates.Sdks;
            PlayFabEditorDataService.SaveEditorSettings();
        }
Exemplo n.º 17
0
        void OnEnable()
        {
            if (window == null)
            {
                window         = this;
                window.minSize = new Vector2(300, 0);
            }

            if (!IsEventHandlerRegistered(StateUpdateHandler))
            {
                EdExStateUpdate += StateUpdateHandler;
            }

            RaiseStateUpdate(EdExStates.OnEnable);
        }
        public static void SaveEnvDetails()
        {
            try
            {
                var serialized = Json.JsonWrapper.SerializeObject(envDetails);
                EditorPrefs.SetString(keyPrefix + "PlayFab_DeveloperEnvironmentDetails", serialized);

                //update scriptable object
                UpdateScriptableObject();
            }
            catch (Exception ex)
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
            }
        }
 public static void LoadAccountDetails()
 {
     if (EditorPrefs.HasKey(keyPrefix + "PlayFab_DeveloperAccountDetails"))
     {
         var serialized = EditorPrefs.GetString(keyPrefix + "PlayFab_DeveloperAccountDetails");
         try
         {
             accountDetails = Json.JsonWrapper.DeserializeObject <PlayFab_DeveloperAccountDetails>(serialized);
             return;
         }
         catch (Exception ex)
         {
             PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
         }
     }
     accountDetails = new PlayFab_DeveloperAccountDetails();
 }
 public static void LoadEditorSettings()
 {
     if (EditorPrefs.HasKey(keyPrefix + "PlayFab_EditorSettings"))
     {
         var serialized = EditorPrefs.GetString(keyPrefix + "PlayFab_EditorSettings");
         try
         {
             editorSettings = Json.JsonWrapper.DeserializeObject <PlayFab_EditorSettings>(serialized);
             LoadFromScriptableObject();
             return;
         }
         catch (Exception ex)
         {
             PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
         }
     }
     editorSettings = new PlayFab_EditorSettings();
 }
        private static void RemoveSDK(bool prompt = true)
        {
            if (prompt)
            {
                if (!EditorUtility.DisplayDialog("Confirm SDK Removal", "This action will remove the current PlayFab SDK. Related plug-ins will need to be manually removed.", "Confirm", "Cancel"))
                {
                    return;
                }
            }

            //try to clean-up the plugin dirs
            var folders = Directory.GetDirectories(Application.dataPath + "/Plugins", "PlayFabShared", SearchOption.AllDirectories);

            foreach (var folder in folders)
            {
                FileUtil.DeleteFileOrDirectory(folder);
            }


            //try to clean-up the plugin files (if anything is left)
            var files = Directory.GetFiles(Application.dataPath + "/Plugins", "PlayFabErrors.cs", SearchOption.AllDirectories);

            foreach (var file in files)
            {
                FileUtil.DeleteFileOrDirectory(file);
            }


            if (FileUtil.DeleteFileOrDirectory(PlayFabEditorDataService.envDetails.sdkPath))
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnSuccess, "PlayFab SDK Removed!");

                // HACK for 5.4, AssetDatabase.Refresh(); seems to cause the install to fail.
                if (prompt)
                {
                    AssetDatabase.Refresh();
                }
            }
            else
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, "An unknown error occured and the PlayFab SDK could not be removed.");
            }
        }
        public static void SelectLocalFile()
        {
            string starterPath     = File.Exists(PlayFabEditorDataService.envDetails.localCloudScriptPath) ? Application.dataPath : PlayFabEditorDataService.envDetails.localCloudScriptPath;
            string cloudScriptPath = string.Empty;

            try
            {
                cloudScriptPath = EditorUtility.OpenFilePanel("Select your Cloud Script file", starterPath, "js");
            }
            catch (Exception ex)
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
            }

            if (!string.IsNullOrEmpty(cloudScriptPath))
            {
                PlayFabEditorDataService.envDetails.localCloudScriptPath = cloudScriptPath;
                PlayFabEditorDataService.SaveEnvDetails();
            }
        }
        public static void GetCloudScriptRevision()
        {
            // empty request object gets latest versions
            PlayFabEditorApi.GetCloudScriptRevision(new EditorModels.GetCloudScriptRevisionRequest(), (GetCloudScriptRevisionResult result) => {
                var csPath = PlayFabEditorHelper.CLOUDSCRIPT_PATH;

                try
                {
                    System.IO.File.WriteAllText(csPath, result.Files.First().FileContents);
                    Debug.Log("CloudScript uploaded successfully!");
                    PlayFabEditorDataService.envDetails.localCloudScriptPath = csPath;
                    PlayFabEditorDataService.SaveEnvDetails();
                }
                catch (Exception ex)
                {
                    PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
                    return;
                }
            }, PlayFabEditorHelper.SharedErrorCallback);
        }
        public static void SetSettingsProperties()
        {
            if (PlayFabEditorSDKTools.IsInstalled && !_isSettingsSet)
            {
                if (!string.IsNullOrEmpty(PlayFabEditorDataService.envDetails.selectedTitleId))
                {
                    // exists in user's titles?
                    if (!PlayFabEditorDataService.DoesTitleExistInStudios(PlayFabEditorDataService.envDetails.selectedTitleId))
                    {
                        string msg = string.Format("A title id ({0}) that does not belong to one of your studios has been selected. You can update this value on the PROJECT SETTINGS tab within the PlayFab Editor Extensions.", PlayFabEditorDataService.envDetails.selectedTitleId);
                        PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnWarning, msg);
                        _foundUnknownTitleId     = true;
                        _prevSelectedStudioIndex = 0;
                        _selectedStudioIndex     = 0;

                        _TitleId = PlayFabEditorDataService.envDetails.selectedTitleId;

                        #if ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFABSERVER_API
                        _DeveloperSecretKey = PlayFabEditorDataService.envDetails.developerSecretKey;
                        #endif
                    }
                    else
                    {
                        _foundUnknownTitleId = false;
                    }
                }

                if (studioOptions == null || (studioOptions.Length == 0 && PlayFabEditorDataService.accountDetails.studios.Count > 0))
                {
                    BuildDropDownLists();
                }

                _RequestTimeOut = PlayFabEditorDataService.envDetails.timeOut;
                _KeepAlive      = PlayFabEditorDataService.envDetails.keepAlive;

                _isSettingsSet = true;
            }
        }
Exemplo n.º 25
0
        private static void OnLoginButtonClicked()
        {
            PlayFabEditorApi.Login(new LoginRequest()
            {
                DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
                DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
                Email    = _userEmail,
                Password = _userPass
            }, (result) =>
            {
                PlayFabEditorDataService.accountDetails.devToken = result.DeveloperClientToken;
                PlayFabEditorDataService.accountDetails.email    = _userEmail;

                PlayFabEditorApi.GetStudios(new GetStudiosRequest(), (getStudioResult) =>
                {
                    PlayFabEditorDataService.accountDetails.studios = getStudioResult.Studios.ToList();
                    PlayFabEditorDataService.SaveAccountDetails();
                }, PlayFabEditorHelper.SharedErrorCallback);

                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
                PlayFabEditorDataService.SaveAccountDetails();
                PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
            }, (error) =>
            {
                if ((int)error.Error == 1246 || error.ErrorMessage.Contains("TwoFactor"))
                {
                    // pop 2FA dialog
                    PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnWarning, "This account requires 2-Factor Authentication.");
                    activeState = PanelDisplayStates.TwoFactorPrompt;
                }
                else
                {
                    PlayFabEditorHelper.SharedErrorCallback(error);
                }
            });
        }
Exemplo n.º 26
0
 public static void OnInternalTitleDataClicked()
 {
     //currentState = DataMenuStates.TitleDataInternal;
     PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnSubmenuItemClicked, DataMenuStates.TitleDataInternal.ToString(), "" + (int)DataMenuStates.TitleDataInternal);
 }
Exemplo n.º 27
0
 public static void SharedErrorCallback(string error)
 {
     PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, error);
 }
Exemplo n.º 28
0
 public static void SharedErrorCallback(EditorModels.PlayFabError error)
 {
     PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, error.ErrorMessage);
 }
Exemplo n.º 29
0
        internal static void MakeApiCall <TRequestType, TResultType>(string api, string apiEndpoint, TRequestType request, Action <TResultType> resultCallback, Action <EditorModels.PlayFabError> errorCallback)
        {
            var url = apiEndpoint + api;
            var req = JsonWrapper.SerializeObject(request, PlayFabEditorUtil.ApiSerializerStrategy);
            //Set headers
            var headers = new Dictionary <string, string>
            {
                { "Content-Type", "application/json" },
                { "X-ReportErrorAsSuccess", "true" },
                { "X-PlayFabSDK", string.Format("{0}_{1}", PlayFabEditorHelper.EDEX_NAME, PlayFabEditorHelper.EDEX_VERSION) }
            };


            if (api.Contains("/Server/") || api.Contains("/Admin/"))
            {
                if (PlayFabEditorDataService.activeTitle == null || string.IsNullOrEmpty(PlayFabEditorDataService.activeTitle.SecretKey))
                {
                    PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, "Must have PlayFabSettings.DeveloperSecretKey set to call this method");
                    return;
                }

                headers.Add("X-SecretKey", PlayFabEditorDataService.activeTitle.SecretKey);
            }



            //Encode Payload
            var payload = System.Text.Encoding.UTF8.GetBytes(req.Trim());

            var www = new WWW(url, payload, headers);

            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnHttpReq, api, PlayFabEditorHelper.MSG_SPIN_BLOCK);

            EditorCoroutine.start(Post(www, (response) =>
            {
                var httpResult = JsonWrapper.DeserializeObject <HttpResponseObject>(response,
                                                                                    PlayFabEditorUtil.ApiSerializerStrategy);

                if (httpResult.code == 200)
                {
                    try
                    {
                        PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnHttpRes, api);

                        var dataJson = JsonWrapper.SerializeObject(httpResult.data,
                                                                   PlayFabEditorUtil.ApiSerializerStrategy);
                        var result = JsonWrapper.DeserializeObject <TResultType>(dataJson,
                                                                                 PlayFabEditorUtil.ApiSerializerStrategy);

                        if (resultCallback != null)
                        {
                            resultCallback(result);
                        }
                    }
                    catch (Exception e)
                    {
                        PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, e.Message);
                    }
                }
                else
                {
                    if (errorCallback != null)
                    {
                        PlayFab.Editor.EditorModels.PlayFabError playFabError = PlayFabEditorHelper.GeneratePlayFabError(response);
                        errorCallback(playFabError);
                    }
                    else
                    {
                        PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, string.Format("ErrorCode:{0} -- {1}", httpResult.code, httpResult.status));
                    }
                }
            }, (error) =>
            {
                if (errorCallback != null)
                {
                    var playFabError = PlayFabEditorHelper.GeneratePlayFabError(error);
                    errorCallback(playFabError);
                }
                else
                {
                    PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, error);
                }
            }), www);
        }
Exemplo n.º 30
0
        static void RemoveAndroidPushPlugin()
        {
            try
            {
                var           androidPluginPath = Application.dataPath + "/Plugins/Android/";
                List <string> filesToRemove     = new List <string>()
                {
                    "PlayFab",
                    "PlayFabAdInfo.aar",
                    "PlayFabUnityAndroid.aar"
                };

                foreach (var file in filesToRemove)
                {
                    if (FileUtil.DeleteFileOrDirectory(androidPluginPath + file))
                    {
                        Debug.Log(androidPluginPath + file + " -- Removed.");
                    }
                    else
                    {
                        Debug.LogWarning(androidPluginPath + file + " -- Could not be found.");
                    }
                }

                if (EditorUtility.DisplayDialog("Confirm Removal of Android Libraries", "Do you also want to remove the Android .aar libraries are used by the PlayFab Plugin? Discretion is advised, these files may also be shared among other unrelated plugins. ", "Yes", "No"))
                {
                    List <string> optionalFilesToRemove = new List <string>()
                    {
                        "appcompat-v7*.aar",
                        "play-services-base*.aar",
                        "play-services-basement*.aar",
                        "play-services-gcm*.aar",
                        "play-services-iid*.aar",
                        "support-v4*.aar"
                    };

                    //using wild card here to get variations on versions if they exist.
                    DirectoryInfo pluginDir = new DirectoryInfo(androidPluginPath);
                    if (pluginDir != null)
                    {
                        foreach (var opt in optionalFilesToRemove)
                        {
                            //TODO ensure that we only want to search the top of the dir
                            var files = pluginDir.GetFiles(opt, SearchOption.TopDirectoryOnly);
                            foreach (var file in files)
                            {
                                if (FileUtil.DeleteFileOrDirectory(androidPluginPath + file.Name))
                                {
                                    Debug.Log(androidPluginPath + file + " -- Removed.");
                                }
                                else
                                {
                                    Debug.LogWarning(androidPluginPath + file + " -- Could not be found.");
                                }
                            }
                        }
                    }
                }

                if (EditorUtility.DisplayDialog("Confirm Removal of AndroidManifest.xml", "Do you want to also remove AndroidManifest.xml? Discretion is advised, as this may impact the performance of your Android builds.", "Yes", "No"))
                {
                    FileUtil.DeleteFileOrDirectory(Application.dataPath + "/Plugins/Android/AndroidManifest.xml");
                }

                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnSuccess, "Android Push Plugin Removed");
                AssetDatabase.Refresh();
            }
            catch (Exception ex)
            {
                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
            }
        }