Ejemplo n.º 1
0
    private IEnumerator GetCurrentLocationRangeOtherData(string _url, WWWForm _wForm, System.Action <List <PlayerStrongholdAttribute>, List <BusinessStrongholdAttribute> > callback)
    {
        AndaUIManager.Instance.OpenWaitBoard(true);
        WWW postData = new WWW(_url, _wForm);

        yield return(postData);

        AndaUIManager.Instance.OpenWaitBoard(false);
        if (postData.error != null)
        {
            Debug.Log(postData.error);
        }
        else
        {
            var data = JsonMapper.ToObject <Region>(postData.text);

            List <PlayerStrongHoldGrowUpAttribute> tmpPlayerStronghold = data.resRegion.PlayerStrongHoldlist;


            List <BusinessStrongholdGrowUpAttribute> tmpBusinessStronghold = data.resRegion.BusinessStrongHoldlist;

            List <PlayerStrongholdAttribute>   playerStrongholds   = new List <PlayerStrongholdAttribute>();
            List <BusinessStrongholdAttribute> businessStrongholds = new List <BusinessStrongholdAttribute>();

            foreach (var go in tmpPlayerStronghold)
            {
                PlayerStrongholdAttribute psa = ConvertTool.ConvertToPlayerstrongholdAttribute(go);
                //Debug.Log("go.strongholdGloryValue" + go.strongholdGloryValue);
                playerStrongholds.Add(psa);
            }

            foreach (var go in tmpBusinessStronghold)
            {
                BusinessStrongholdAttribute bsa = ConvertTool.ConvertToBussinessStrongholdAttribute(go);
                bsa.strongholdID = 30005;
                businessStrongholds.Add(bsa);
            }
            callback(playerStrongholds, businessStrongholds);
        }
    }