예제 #1
0
    private IEnumerator ExcuteCallServerRemoveStrongholdReward(string _url, WWWForm _wForm, int rewardIndex, int shIndex, System.Action <bool, int> callback)
    {
        AndaUIManager.Instance.OpenWaitBoard(true);
        WWW postData = new WWW(_url, _wForm);

        yield return(postData);

        Debug.Log("PostData" + postData.text);
        AndaUIManager.Instance.OpenWaitBoard(false);
        if (postData.error != null)
        {
            Debug.Log(postData.error);
        }
        else
        {
            BusinessCouponRequest result = JsonMapper.ToObject <BusinessCouponRequest>(postData.text);
            AndaDataManager.Instance.mainData.UpdateReduceStrongholdReward(shIndex, rewardIndex);
            callback(result.code == "200", rewardIndex);
        }
    }
예제 #2
0
    private IEnumerator ExcuteCallServerUploadReward(string _url, WWWForm _wForm, System.Action <bool> callback)
    {
        AndaUIManager.Instance.OpenWaitBoard(true);
        WWW postData = new WWW(_url, _wForm);

        yield return(postData);

        Debug.Log("PostData" + postData.text);
        AndaUIManager.Instance.OpenWaitBoard(false);
        if (postData.error != null)
        {
            Debug.Log(postData.error);
        }
        else
        {
            BusinessCouponRequest result = JsonMapper.ToObject <BusinessCouponRequest>(postData.text);
            AndaDataManager.Instance.mainData.AddBussinessRewar(result.data);
            callback(result.code == "200");
        }
    }