public void SetElseBox(FunctionBoxIf box)
 {
     if (elseBox == null)
     {
         elseBox = box;
     }
     else
     {
         elseBox.SetElseBox(box);
     }
 }
 public override IEnumerator Execute()
 {
     if (judgeFunc())
     {
         return(base.Execute());
     }
     if (elseBox == null)
     {
         elseBox = new FunctionBoxIf(() => true);
     }
     return(elseBox.Execute());
 }
        public void AddBox_ElseIf(FunctionBoxIf box)
        {
            var prev = Peek(boxes).PeekChild();

            if (prev is ActMaker.FunctionBoxIf)
            {
                ((FunctionBoxIf)prev).SetElseBox(box);
                boxes.Add(box);
            }
            else
            {
                Debug.LogError("Script 'ELSE' can't add");
            }
        }