public void BuildBussinessStrongholdAttrubte() { int count = playerData.strongholdList.Count; for (int i = 0; i < count; i++) { if (businessStrongholdAttributes == null) { businessStrongholdAttributes = new List <BusinessStrongholdAttribute>(); } BusinessStrongholdAttribute _b = ConvertTool.ConvertToBussinessStrongholdAttribute(playerData.strongholdList[i]); businessStrongholdAttributes.Add(_b); } }
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); } }
private IEnumerator ExcuteUploadPlayerstornghold(string _url, WWWForm _wForm, System.Action <BusinessStrongholdAttribute> callback) { AndaUIManager.Instance.OpenWaitBoard(true); Debug.Log("uploading"); WWW postData = new WWW(_url, _wForm); yield return(postData); AndaUIManager.Instance.OpenWaitBoard(false); Debug.Log("finish"); if (postData.error != null) { Debug.Log(postData.error); } else { BusinessStrongHoldInfo data = JsonMapper.ToObject <BusinessStrongHoldInfo>(postData.text); BusinessStrongholdAttribute bss = ConvertTool.ConvertToBussinessStrongholdAttribute(data.BusinessStrongHold); AndaDataManager.Instance.mainData.AddBussinessStronghold(bss); callback(bss); } }