コード例 #1
0
        // Use this for initialization
        public void UpdateGames(GameFeaturedResult data)
        {
            var games = data.games;

            foreach (Game featuredGames in data.games)
            {
                GameObject currentGame = Instantiate(featuredGamePreFab, new Vector3(0, 0, 0), Quaternion.identity) as GameObject;

                currentGame.transform.parent = gamesToggleGroup.transform;

                Text nameText = currentGame.GetComponentInChildren <Text> ();
                nameText.text = featuredGames.name;

                Transform background = currentGame.transform.Find("Background");

                Image gameImage = background.GetComponent <Image> ();
                nameText.text = featuredGames.name;

                TacoButton tacoButton = currentGame.GetComponentInChildren <TacoButton> ();

                if (featuredGames.links.Count > 0)
                {
                    // using Name to store the URL - versus adding a new member variable to all buttons
                    tacoButton.Name = featuredGames.links[0].value;
                }


                string url = featuredGames.imageUrl;


                print(url);

                StartCoroutine(ApiManager.Instance.WWWImageLoad(url, gameImage));
            }
        }
コード例 #2
0
        public void GetOurGames()
        {
            TacoManager.OpenMessage(TacoConfig.TacoOurGamesLoadingMessage);
            foreach (Transform child in gamesList)
            {
                Destroy(child.gameObject);
            }
            ourGamesList     = new List <OurGame> ();
            buttons [0].isOn = true;            //set default to all toggle

            Action <string> success = (string data) => {
                GameFeaturedResult r = JsonUtility.FromJson <GameFeaturedResult> (data);
                if (r.success)
                {
                    TacoManager.CloseMessage();
                    UpdateGames(r.games);
                }
            };

            Action <string, string> fail = (string errorData, string error) => {
                Debug.Log("Error on get : " + errorData);
                if (!string.IsNullOrEmpty(error))
                {
                    Debug.Log("Error : " + error);
                }

                TacoManager.CloseMessage();

                TacoManager.OpenModalLoginFailedPanel(TacoConfig.TacoLoginErrorEmailPassword);
            };

            string url = "api/game/featured?userAgent=" + platform;

            StartCoroutine(ApiManager.Instance.GetWithToken(url, success, fail));
        }
コード例 #3
0
        public void ValidateUserOrEmail(string emailToCheck)
        {
            EmailOkay.SetActive(false);

            Action <string> success = (string data) => {
                GameFeaturedResult r = JsonUtility.FromJson <GameFeaturedResult> (data);
                if (r.success)
                {
                    if (data.Contains("true"))
                    {
                        EmailOkay.SetActive(true);
                    }
                }
                ;
            };

            Action <string, string> fail = (string errorData, string error) => {
                Debug.Log("Error on get : " + errorData);
                if (!string.IsNullOrEmpty(error))
                {
                    Debug.Log("Error : " + error);
                }

                TacoManager.CloseMessage();
                TacoManager.OpenModalLoginFailedPanel(TacoConfig.TacoLoginErrorEmailPassword);
            };

            string url = "api/user/verify?u=" + emailToCheck;

            StartCoroutine(ApiManager.Instance.GetWithToken(url, success, fail));
        }
コード例 #4
0
        public void ValidateUserOrEmail(string emailToCheck)
        {
            EmailOkay.SetActive(false);
            TacoModalPanel.Instance.SetModalButtonEnabled(false);

            Action <string> success = (string data) => {
                GameFeaturedResult r = JsonUtility.FromJson <GameFeaturedResult> (data);

                if (r.success)
                {
                    if (data.Contains("true"))
                    {
                        EmailOkay.SetActive(true);
                        TacoModalPanel.Instance.SetModalButtonEnabled(true);
                    }
                    ;
                }
                ;
            };

            Action <string, string> fail = (string errorData, string error) => {
                TacoConfig.print("Error on get : " + errorData);
                if (!string.IsNullOrEmpty(error))
                {
                    TacoConfig.print("Error : " + error);
                }

                TacoManager.CloseMessage();
                string msg = errorData + (string.IsNullOrEmpty(error) ? "" : " : " + error);
                TacoManager.OpenModal(TacoConfig.TacoLoginErrorHeader, TacoConfig.TacoLoginErrorMessage01);
            };


            string url = "api/user/verify?u=" + emailToCheck;

            StartCoroutine(ApiManager.Instance.GetWithToken(url, success, fail));
        }
コード例 #5
0
        public void GetOurGames()
        {
            if (!loadedGames)
            {
                TacoManager.OpenMessage(TacoConfig.TacoOurGamesLoadingMessage);

                Action <string> success = (string data) => {
                    GameFeaturedResult r = JsonUtility.FromJson <GameFeaturedResult> (data);
                    if (r.success)
                    {
                        TacoConfig.print(" GetOurGames Success = " + JsonUtility.ToJson(r));

                        TacoManager.CloseMessage();
                        UpdateGames(r);
                    }
                };

                Action <string, string> fail = (string errorData, string error) => {
                    TacoConfig.print("Error on get : " + errorData);
                    if (!string.IsNullOrEmpty(error))
                    {
                        TacoConfig.print("Error : " + error);
                    }

                    TacoManager.CloseMessage();

                    string msg = errorData + (string.IsNullOrEmpty(error) ? "" : " : " + error);

                    TacoManager.OpenModal(TacoConfig.TacoLoginErrorHeader, TacoConfig.TacoLoginErrorMessage01);
                };

                string url = "api/game/featured";
                StartCoroutine(ApiManager.Instance.GetWithToken(url, success, fail));
                loadedGames = true;
            }
        }
コード例 #6
0
        public void ValidateUserOrEmail(string emailToCheck)
        {
            if (string.IsNullOrEmpty(emailToCheck))
            {
                if (next != null && string.IsNullOrEmpty(next.EmailInput.text) && next.IsInteractable())
                {
                    next.SetInteractable(false);
                }
                return;
            }

            if (next != null && !next.IsInteractable())
            {
                next.SetInteractable(true);
            }

            if (!TacoManager.ValidateEmail(emailToCheck))
            {
                ToggleEmailOkay(false);
                RemoveDuplidateError();
                errorMessage.text = TacoConfig.EnterInvalidEmailError;
                return;
            }

            if (reservedEmails.Contains(GetEmail()))
            {
                ToggleEmailOkay(false);
                RemoveDuplidateError();
                errorMessage.text = TacoConfig.EnterExistingEmailError;
                return;
            }

            Action <string> success = (string data) => {
                GameFeaturedResult r = JsonUtility.FromJson <GameFeaturedResult>(data);

                if (r.success)
                {
                    if (data.Contains("true"))
                    {
                        if (!ValidateDuplidateEmail(emailToCheck))
                        {
                            ToggleEmailOkay(false);
                            errorMessage.text = TacoConfig.EnterExistingEmailError;
                        }
                        else
                        {
                            ToggleEmailOkay(true);
                        }
                        RemoveDuplidateError();
                        previousValidEmailValue = emailToCheck;
                    }
                }
                else
                {
                    ToggleEmailOkay(false);
                    RemoveDuplidateError();

                    errorMessage.text = TacoConfig.NotInSystemEmailError;
                }
            };

            Action <string, string> fail = (string errorData, string error) => {
                Debug.Log("Error on get : " + errorData);
                if (!string.IsNullOrEmpty(error))
                {
                    Debug.Log("Error : " + error);
                }
                TacoManager.CloseMessage();
                //string msg = errorData + (string.IsNullOrEmpty (error) ? "" : " : " + error);
                TacoManager.OpenModalLoginFailedPanel(TacoConfig.TacoLoginErrorEmailPassword);
                //TacoManager.OpenModal (TacoConfig.TacoLoginErrorHeader, TacoConfig.TacoLoginErrorMessage01);
            };


            string url = "api/user/verify?u=" + emailToCheck;

            StartCoroutine(ApiManager.Instance.GetWithToken(url, success, fail));
        }