public virtual void StartRequest() { if (AsyncRequestOperation.Status != AsyncStatusEnum.Processing) { var enumerator = ProcessRequestInternal(); RequestStackManager.RequestRoutine(this, enumerator); AsyncRequestOperation.Status = RequestStackManager.IsRequesting(enumerator) ? AsyncStatusEnum.Processing : AsyncStatusEnum.Cancelled; if (AsyncRequestOperation.Status == AsyncStatusEnum.Processing) { MarkedToDestroy.RemoveMark(this.gameObject); RegisterEvents(); } } }
private IEnumerator ProcessRequestInternal() { MarkedToDestroy.RemoveMark(this.gameObject); AsyncRequestOperation.Status = AsyncStatusEnum.Processing; yield return(ProcessRequest()); AsyncRequestOperation.Status = AsyncStatusEnum.Done; foreach (var v_func in FunctionsToCallWhenFinish) { if (v_func != null) { v_func.Params.Clear(); v_func.Params.Add(AsyncRequestOperation); v_func.CallFunction(); } } DestroyUtils.Destroy(this.gameObject); }