Exemplo n.º 1
0
        public void Delete()
        {
            if (string.IsNullOrEmpty(key.text) || string.IsNullOrEmpty(key.text))
            {
                PopupSystem.ShowPopup("Please enter valid text for key and value", null, "Close", () =>
                {
                }, url: keySucces, isError: true);

                return;
            }
            LoadingManager.ShowLoadingScreen();
            LootLockerSDKManager.DeleteKeyValue(key.text, (response) =>
            {
                LoadingManager.HideLoadingScreen();
                if (response.success)
                {
                    Dictionary <string, string> data = new Dictionary <string, string>();
                    data.Add("Key", key.text);

                    PopupSystem.ShowPopup("Deletion Successful", data, "Close", () =>
                    {
                        StagesManager.instance.GoToStage(StagesManager.StageID.Storage, null);
                        GetComponent <ScreenCloser>()?.Close();
                        PopupSystem.CloseNow();
                    }, url: keySucces);
                }
            });
        }
Exemplo n.º 2
0
        public void Save()
        {
            if (string.IsNullOrEmpty(key.text) || string.IsNullOrEmpty(key.text))
            {
                PopupSystem.ShowPopup("Please enter valid text for key and value", null, "Close", () =>
                {
                }, url: keySucces, isError: true);

                return;
            }
            LoadingManager.ShowLoadingScreen();
            LootLockerSDKManager.UpdateOrCreateKeyValue(key.text, value.text, (response) =>
            {
                LoadingManager.HideLoadingScreen();
                if (response.success)
                {
                    Dictionary <string, string> data = new Dictionary <string, string>();
                    data.Add("Key", key.text);
                    data.Add("Value", value.text);
                    DemoAppGetPersistentStoragResponse mainResponse = JsonConvert.DeserializeObject <DemoAppGetPersistentStoragResponse>(response.text);
                    PopupSystem.ShowPopup("Save Successful", data, "Close", () =>
                    {
                        StagesManager.instance.GoToStage(StagesManager.StageID.Storage, mainResponse);
                        GetComponent <ScreenCloser>()?.Close();
                        PopupSystem.CloseNow();
                    }, url: keySucces);
                }
            });
        }
Exemplo n.º 3
0
 public void Close()
 {
     LoadingManager.HideLoadingScreen();
     PopupSystem.CloseNow();
 }