Ejemplo n.º 1
0
    IEnumerator CloseRetoC()
    {
        string id = openReto.id.ToString();

        string userID  = openReto.userID.ToString();
        string userID2 = openReto.userID2.ToString();

        string score  = openReto.score.ToString();
        string score2 = openReto.score2.ToString();

        string hash     = Utils.Md5Sum(id + secretKey);
        string post_url = closeRetoURL + "?id=" + id;

        post_url += "&userID=" + userID + "&userID2=" + userID2;
        post_url += "&score=" + score + "&score2=" + score2;
        post_url += "&hash=" + hash;
        print(post_url);
        WWW www = new WWW(post_url);

        yield return(www);

        if (www.error != null)
        {
            Events.OnPopup("There was an error: " + www.error);
        }
        else
        {
            string result = www.text;
            Events.OnPopup("Reto cerrado " + www.text);
            retosContent.all.Remove(openReto);
            openReto = new RetoData();
            UserData.Instance.UpdateData();
        }
        yield return(null);
    }
Ejemplo n.º 2
0
 public void PlayReto(RetoData data)
 {
     Events.OnSoundFX("ui");
     Data.Instance.retosManager.SetOpenReto(data);
     Data.Instance.triviaData.Load(data.tag_id);
     LoadScreen(2, true);
 }
Ejemplo n.º 3
0
    void AddButton(RetoData data)
    {
        RetoLine b = Instantiate(button);

        b.transform.SetParent(container);
        b.Init(this, data);
        b.transform.localScale = Vector3.one;
    }
Ejemplo n.º 4
0
    public override void OnEnabled()
    {
        RetoData openRetoData = Data.Instance.retosManager.openReto;

        if (openRetoData.userID == "")
        {
            vsPanel.SetActive(false);
        }
        else
        {
            vsPanel.SetActive(true);
            vsUsername.text = openRetoData.username;
        }
        field.text = Data.Instance.triviaData.triviaName.ToUpper();
    }
Ejemplo n.º 5
0
 public void SetOpenReto(RetoData openReto)
 {
     this.openReto = openReto;
 }
Ejemplo n.º 6
0
 public void Init(RetosUI ui, RetoData data)
 {
     this.ui   = ui;
     this.data = data;
     LoadData();
 }