예제 #1
0
 public virtual void Generate(ref int coroutineId)
 {
     this.Coroutine = Context.CoroutineManager.GetCoroutineHandle(coroutineId);
     Actuator.Generate(coroutineId);
     // 只有在StepData的LoopCounter不为null,loop最大值大于1,并且Step类型不是ConditionLoop的情况下才会执行LoopCounter
     this._hasLoopCounter = (StepData?.LoopCounter != null && StepData.LoopCounter.MaxValue > 1 &&
                             StepData.StepType != SequenceStepType.ConditionLoop);
     this._isUnderRetryStep = IsUnderRetryBlock();
     if (StepData?.HasSubSteps ?? false)
     {
         StepTaskEntityBase subStepEntity = SubStepRoot;
         do
         {
             subStepEntity.Generate(ref coroutineId);
         } while (null != (subStepEntity = subStepEntity.NextStep));
     }
     InintializeInvokeAction();
 }
예제 #2
0
        public void Generate(int startCoroutineId)
        {
            this.RootCoroutineId = startCoroutineId;
            this.State           = RuntimeState.TestGen;
            _stepEntityRoot      = ModuleUtils.CreateStepModelChain(_sequence.Steps, _context, _sequence.Index);
            if (null == _stepEntityRoot)
            {
                return;
            }

            StepTaskEntityBase stepEntity = _stepEntityRoot;

            do
            {
                stepEntity.Generate(ref startCoroutineId);
            } while (null != (stepEntity = stepEntity.NextStep));

            this.State = RuntimeState.StartIdle;
            // 添加当前根节点到stepModel管理中
            StepTaskEntityBase.AddSequenceEntrance(_stepEntityRoot);
        }