Пример #1
0
 public void AmountSelectionMethod()
 {
     print("AmountSelectionMethod");
     GameLobbyName = EventSystem.current.currentSelectedGameObject.name;
     LoadingImage.SetActive(true);
     CreateRoomButton.SetActive(false);
     StartCoroutine(AmountCheckingBeforeEntering());
 }
Пример #2
0
        IEnumerator AmountCheckingBeforeEntering()
        {
            print("AmountCheckingBeforeEntering");
            UnityWebRequest www = new UnityWebRequest("http://apienjoybtc.exioms.me/api/Balance/balancefetch?userid=" + PlayerPrefs.GetString("userid") + "&gamesessionid=1&dblbidamt=" + GameLobbyName);

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

            if (www.error != null)
            {
                print("Something went Wrong");
            }
            string msg = www.downloadHandler.text;

            msg = msg.Substring(1, msg.Length - 2);
            JSONNode jn = SimpleJSON.JSONData.Parse(msg);

            msg = null;
            msg = jn [0];
            if (msg.Equals("Successful"))
            {
                print("GameLobbyName:" + GameLobbyName);
                print("Have enough balance");
                StartCoroutine(WarningForRoom("You can bid", .5f));
                CreateRoomButton.SetActive(true);
                LoadingImage.SetActive(false);
            }
            else if (msg.Equals("Youdon'thavesufficientbalanceforbid"))
            {
                print("You don't have sufficient balance for bid");
                CreateRoomButton.SetActive(true);
                GameLobbyName = null;
                GameLobbyName = "nothing";
                StartCoroutine(WarningForRoom("You don't have sufficient balance for bid", 2));
            }
        }