IEnumerator Loop3(int Loop) { int CheckCode = 0; for (int i = 0; i < Loop; i++) { //隨機亂數 yield return(StartCoroutine(MakeRandom(CT1.useL1DB.random))); //亮燈 yield return(StartCoroutine(ShowLight())); //答案比對 yield return(StartCoroutine(AnswerCompare())); //重置 yield return(StartCoroutine(Reset())); if (CT1.Feedback()) { CheckCode = 1; break; } if (CT1.IfTimeOut) { CheckCode = 2; break; } } yield return(CheckCode); //回傳至Loop2 }
public override IEnumerator Loop2(params object[] args) { var Loop = (int)args [0]; var random = (int)args [1]; var step = (int)args [2]; var mapIndex = (int)args [3]; CT1.useL1DB.random = random; mCamera.Step(step); int CheckCode = 0; if (!CT1.useL1DB.start) { for (int j = 0; j <= mapIndex; j++) { yield return(StartCoroutine(LevelManagement(CT1.Get_arrangement(j)))); } } for (int i = 0; i < Loop; i++) { //隨機亂數 yield return(StartCoroutine(MakeRandom(CT1.useL1DB.random))); //亮燈 yield return(StartCoroutine(ShowLight())); //答案比對 yield return(StartCoroutine(AnswerCompare())); //重置 yield return(StartCoroutine(Reset())); if (CT1.Feedback()) { CheckCode = 1; break; } if (CT1.IfTimeOut) { CheckCode = 2; break; } } yield return(CheckCode); //回傳至Loop1 }
public override IEnumerator Loop2(params object[] args) { var Loop = (int)args [0]; var random = (int)args [1]; var maps = (List <List <Vector3> >)args [2]; CT1.useL1DB.random = random; int CheckCode = 0, Count = 0, index = 0; while (Count++ != Loop) { if (index == maps.Count) { index = 0; } yield return(StartCoroutine(LevelManagement(maps [index++], false))); //隨機亂數 yield return(StartCoroutine(MakeRandom(CT1.useL1DB.random))); //亮燈 yield return(StartCoroutine(ShowLight())); //答案比對 yield return(StartCoroutine(AnswerCompare())); //重置 yield return(StartCoroutine(Reset())); if (CT1.Feedback()) { CheckCode = 1; break; } if (CT1.IfTimeOut) { CheckCode = 2; break; } yield return(null); } yield return(CheckCode); //回傳至Loop1 }
public override IEnumerator Loop2(params object[] args) { var Loop = (int)args [0]; var random = (int)args [1]; var map = (List <Vector3>)args [2]; CT1.useL1DB.random = random; int CheckCode = 0; for (int i = 0; i < Loop; i++) { yield return(StartCoroutine(LevelManagement(map, true))); //隨機亂數 yield return(StartCoroutine(MakeRandom(CT1.useL1DB.random))); //亮燈 yield return(StartCoroutine(ShowLight())); //答案比對 yield return(StartCoroutine(AnswerCompare())); //重置 yield return(StartCoroutine(Reset())); if (CT1.Feedback()) { CheckCode = 1; break; } if (CT1.IfTimeOut) { CheckCode = 2; break; } } yield return(CheckCode); //回傳至Loop1 }