示例#1
0
        private static bool isOperationsInProgress(MonoBehaviour behavior, IList <ISyncOperation> operations)
        {
            //Profiler.BeginSample(string.Format("{0}[{1}].isOperationsInProgress({2})", behavior.GetType().Name, behavior.name, operations != null ? operations.Count : 0));

            bool result = false;

            if (null != operations)
            {
                for (int i = 0; i < operations.Count; i++)
                {
                    ISyncOperation operation = operations[i];
                    if (operation == null)
                    {
                        continue;
                    }

                    //Profiler.BeginSample(string.Format("{0}.IsComplete()", operation.GetType().Name));
                    if (null != operations[i] && !operations[i].IsComplete())
                    {
                        result = true;
                        //	Profiler.EndSample();
                        break;
                    }
                    //Profiler.EndSample();
                }
            }
            //Profiler.EndSample();
            return(result);
        }
示例#2
0
 public virtual OperationAggregator HasOperation(ISyncOperation newOperation)
 {
     Operations.Add(newOperation);
     newOperation.SetParent(this);
     newOperation.OperationCompleted += OnOperationCompleted;
     return(this);
 }
 public void Play()
 {
     started   = true;
     operation = operationProvider();
 }
 public LazyAsyncOperationScenarioItem(Func <ISyncOperation> operationProvider)
 {
     this.started           = false;
     this.operationProvider = operationProvider;
     this.operation         = null;
 }
示例#5
0
 public AsyncOperationScenarioItem(ISyncOperation syncOperation)
 {
     this.started       = false;
     this.syncOperation = syncOperation;
 }