示例#1
0
 public IEnumerator RunYield(BloxContainer container)
 {
     if (this.active && this.firstBlock != null)
     {
         this.container = container;
         this.flowSig   = BloxFlowSignal.None;
         BloxBlock b        = this.firstBlock;
         int       deadlock = 0;
         while (true)
         {
             if (b != null)
             {
                 if (b == this.firstBlock)
                 {
                     deadlock++;
                     if (deadlock >= BloxGlobal.Instance.deadlockDetect)
                     {
                         break;
                     }
                 }
                 b.Run();
                 if (this.flowSig == BloxFlowSignal.Wait)
                 {
                     yield return(b.yieldInstruction);
                 }
                 else
                 {
                     if (this.flowSig == BloxFlowSignal.Continue)
                     {
                         this.flowSig = BloxFlowSignal.None;
                         b            = this.firstBlock;
                         continue;
                     }
                     if (this.flowSig == BloxFlowSignal.Break)
                     {
                         yield break;
                     }
                     if (this.flowSig == BloxFlowSignal.Stop)
                     {
                         yield break;
                     }
                 }
                 b = b.next;
                 continue;
             }
             yield break;
         }
         Debug.LogErrorFormat(container.gameObject, "Deadlock detected in Event [{0}:{1}]. Forcing stop.", container.gameObject.name, this.screenName);
     }
 }
示例#2
0
 public object Run()
 {
     this.flowSig = BloxFlowSignal.None;
     if (this.active && this.isValid)
     {
         object result = this.RunBlock();
         if (this.parentBlock != null)
         {
             this.parentBlock.flowSig = this.flowSig;
             return(result);
         }
         this.owningEvent.flowSig = this.flowSig;
         return(result);
     }
     return(null);
 }
示例#3
0
        private IEnumerator _RunChildBlocksYield()
        {
            this.flowSig = BloxFlowSignal.None;
            BloxBlock b        = this.firstChild;
            int       deadlock = 0;

            while (true)
            {
                if (b != null)
                {
                    if (b == this.firstChild)
                    {
                        deadlock++;
                        if (deadlock >= BloxGlobal.Instance.deadlockDetect)
                        {
                            break;
                        }
                    }
                    b.Run();
                    if (this.flowSig == BloxFlowSignal.Wait)
                    {
                        this.yieldInstruction = b.yieldInstruction;
                        yield return(b.yieldInstruction);
                    }
                    else
                    {
                        if (this.flowSig == BloxFlowSignal.Continue)
                        {
                            yield break;
                        }
                        if (this.flowSig == BloxFlowSignal.Break)
                        {
                            yield break;
                        }
                        if (this.flowSig == BloxFlowSignal.Stop)
                        {
                            yield break;
                        }
                    }
                    b = b.next;
                    continue;
                }
                yield break;
            }
            Debug.LogErrorFormat(this.owningEvent.container.gameObject, "Deadlock detected in Event [{0}:{1}]. Forcing stop.", this.owningEvent.container.gameObject.name, this.owningEvent.screenName);
            this.flowSig = BloxFlowSignal.Break;
        }
示例#4
0
 public void Run(BloxContainer container)
 {
     if (this.active && this.firstBlock != null)
     {
         this.container = container;
         this.flowSig   = BloxFlowSignal.None;
         BloxBlock next = this.firstBlock;
         int       num  = 0;
         while (true)
         {
             if (next != null)
             {
                 if (next == this.firstBlock)
                 {
                     num++;
                     if (num >= BloxGlobal.Instance.deadlockDetect)
                     {
                         break;
                     }
                 }
                 next.Run();
                 if (this.flowSig == BloxFlowSignal.Continue)
                 {
                     this.flowSig = BloxFlowSignal.None;
                     next         = this.firstBlock;
                 }
                 else
                 {
                     if (this.flowSig == BloxFlowSignal.Break)
                     {
                         return;
                     }
                     if (this.flowSig == BloxFlowSignal.Stop)
                     {
                         return;
                     }
                     next = next.next;
                 }
                 continue;
             }
             return;
         }
         Debug.LogErrorFormat(container.gameObject, "Deadlock detected in Event [{0}:{1}]. Forcing stop.", container.gameObject.name, this.screenName);
     }
 }
示例#5
0
        private void _RunChildBlocks()
        {
            BloxBlock bloxBlock = this.firstChild;
            int       num       = 0;

            while (true)
            {
                if (bloxBlock != null)
                {
                    if (bloxBlock == this.firstChild)
                    {
                        num++;
                        if (num >= BloxGlobal.Instance.deadlockDetect)
                        {
                            break;
                        }
                    }
                    bloxBlock.Run();
                    if (this.flowSig == BloxFlowSignal.Continue)
                    {
                        return;
                    }
                    if (this.flowSig == BloxFlowSignal.Break)
                    {
                        return;
                    }
                    if (this.flowSig == BloxFlowSignal.Stop)
                    {
                        return;
                    }
                    bloxBlock = bloxBlock.next;
                    continue;
                }
                return;
            }
            Debug.LogErrorFormat(this.owningEvent.container.gameObject, "Deadlock detected in Event [{0}:{1}]. Forcing stop.", this.owningEvent.container.gameObject.name, this.owningEvent.screenName);
            this.flowSig = BloxFlowSignal.Break;
        }