protected override void OnStart()
        {
            base.OnStart();

            props.IsEventTriggered = false;

            SubscribeEvent <SimpleEventTriggeredEvent>();

            ChildTask.EnqueueForUpdate();
        }
        protected override void OnStart()
        {
            base.OnStart();

            props.WaitForChildCompleted = true;
            props.Count = 0;

            if (description.ShareCount)
            {
                SetSharedVariable("LoopCount", VariableType.UInteger, VariableSource.LiteralConstant, props.Count.ToString());
            }

            ChildTask.EnqueueForUpdate();
        }
        protected override TaskResult OnUpdate()
        {
            if (props.WaitForChildCompleted)
            {
                if (ChildTask.LastResult == TaskResult.Running)
                {
                    return(TaskResult.Running);
                }

                ++props.Count;
                if (description.ShareCount)
                {
                    SetSharedVariable("LoopCount", VariableType.UInteger, VariableSource.LiteralConstant, props.Count.ToString());
                }

                if (description.Count > 0 && props.Count >= description.Count)
                {
                    return(TaskResult.Failure);
                }

                if (!IsRepeaterCompleted(ChildTask.LastResult))
                {
                    props.WaitForChildCompleted = false;
                    if (Owner.CurrentTime > props.LastUpdateTime)
                    {
                        EnqueueForUpdate();
                    }
                    else
                    {
                        EnqueueForNextUpdate();
                    }
                }
            }
            else
            {
                props.WaitForChildCompleted = true;
                ChildTask.EnqueueForUpdate();
            }

            props.LastUpdateTime = Owner.CurrentTime;

            return(TaskResult.Running);
        }
Beispiel #4
0
        protected override void OnStart()
        {
            base.OnStart();

            ChildTask.EnqueueForUpdate();
        }