Exemplo n.º 1
0
        private IEnumerator Routine(List <string> codeStrList)
        {
            var codeStrListTemp = codeStrList.ToList();

            while (codeStrListTemp.Count > 0)
            {
                var codeStr = codeStrListTemp[0];
                Debug.Log($"执行伪代码: {codeStr}");
                yield return(PseudocodeHelper.RunCode(codeStr));

                yield return(new WaitForSeconds(1));

                codeStrListTemp.RemoveAt(0);
            }
        }
Exemplo n.º 2
0
 private void Start()
 {
     if (mode == ExcuteMode.CommonExcute)
     {
         for (int i = 0; i < codeList.Count; i++)
         {
             var codeStr = codeList[i];
             Debug.Log($"执行伪代码: {codeStr}");
             PseudocodeHelper.Run(codeStr);
         }
     }
     else if (mode == ExcuteMode.CoroutineExcute)
     {
         StartCoroutine(Routine(codeList));
     }
 }