Пример #1
0
 public void LossTransactionMethod()
 {
     TotalWinText.GetComponent <Text> ().enabled   = false;
     TotalLossCount.GetComponent <Text> ().enabled = true;
     TotalMatchText.GetComponent <Text> ().enabled = false;
     AllTransaction.SetActive(false);
     WinTransaction.SetActive(false);
     LossTransaction.SetActive(true);
 }
Пример #2
0
    IEnumerator WinTransactioAPI()
    {
        print("http://apienjoybtc.exioms.me/api/Balance/gametransaction?userid=" + PlayerPrefs.GetString("userid") + "&gamesessionid=1");
        UnityWebRequest www = new UnityWebRequest("http://apienjoybtc.exioms.me/api/Balance/gametransaction?userid=" + PlayerPrefs.GetString("userid") + "&gamesessionid=1&inttranstype=1");

        www.chunkedTransfer = false;
        www.downloadHandler = new DownloadHandlerBuffer();
        yield return(www.SendWebRequest());

        if (www.error != null)
        {
            print("Something went wrong");
        }
        else
        {
            string msg = www.downloadHandler.text;
            print(msg);
            msg = msg.Substring(1, msg.Length - 2);
            print(msg);
            if (!msg.Contains("ul"))
            {
                msg = msg.Insert(0, "[");
                msg = msg.Insert(msg.Length, "]");
                print(msg);
                JSONNode jn = SimpleJSON.JSONData.Parse(msg);

                print(jn);

                int num1 = 0, num2 = 1, num3 = 2, num4 = 3;
                foreach (JSONNode jn1 in jn.Childs)
                {
                    print(jn1);
                    if (jn1 [num1].Value.Equals("SessionisLogout"))
                    {
                        SceneManager.LoadScene("Home");
                    }
                    print(jn1 [num1] + " " + jn1 [num2] + " " + jn1 [num3] + " " + jn1 [num4]);

                    GameObject data = Instantiate(WinRowData, WinParentObject.transform.position, WinParentObject.transform.rotation, WinParentObject1.transform);
                    data.transform.localScale = WinParentObject.transform.localScale;
                    if (jn1 [num1].Value.Equals("1"))
                    {
                        data.transform.GetComponent <Text> ().text = " " + jn1 [num2] + " " + "win" + " " + jn1 [num3] + " " + jn1 [num4];
                    }
                    winCount         += 1;
                    TotalWinText.text = "TOTAL WIN'S:" + winCount;
                    TotalWinText.GetComponent <Text> ().enabled = false;
                }
            }
            WinTransaction.SetActive(false);
            StartCoroutine(LossTransactionAPI());
        }
    }