public override IEnumerator Loop1(int Select_Level_number) { int number = Select_Level_number - 1; IEnumerator e = null; for (int i = 0; i < LevelParameter [number].GetLength(0); i++) { var Loop = LevelParameter [number] [i, 0, 0]; var random = LevelParameter [number] [i, 0, 1]; var mapRange1 = LevelParameter [number] [i, 1, 0]; //0 var mapRange2 = LevelParameter [number] [i, 1, 1]; //3 var maps = CT1.Get_MapRange(mapRange1, mapRange2); //0~3,取得指定範圍地圖陣列 e = Loop2(Loop, random, maps); yield return(StartCoroutine(e)); if ((int)e.Current != 0) { break; } } yield return(e.Current); //回傳至GameLoop }
public override IEnumerator Loop1(int Select_Level_number) { int number = Select_Level_number - 1; IEnumerator e = null; for (int i = 0; i < LevelParameter [number].GetLength(0); i++) { var Loop = LevelParameter [number] [i, 0]; var map = CT1.Get_arrangement(LevelParameter [number] [i, 1]); var random = LevelParameter [number] [i, 2]; e = Loop2(Loop, random, map); yield return(StartCoroutine(e)); if ((int)e.Current != 0) { break; } } yield return(e.Current); //回傳至GameLoop }
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 LevelManagement(params object[] args) { var map = (List <Vector3>)args [0]; CT1.DisplaySliderBar(); //更新難度條 var Balance = map.Count; //多(少)幾台 List <UFO> Group = UFO.InstantiateUFOs(Balance); //實例化UFO //重設場上所有UFO座標 for (int i = 0; i < Group.Count; i++) { Group [i].moveTo(0.7f, map [i], true, 0.1f); } yield break; }
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 }
public override IEnumerator Loop2(params object[] args) { var number = (int)args [0]; //只抓取陣列第一筆資料 var Loop = LevelParameter [number] [0, 0, 1]; var CameraStep = LevelParameter [number] [0, 0, 4]; mCamera.Step(CameraStep); //設定camera距離 //用來使群組能順逆轉 int dirCount = 0; int dir = 1; int random = 0; for (int i = 0; i < LevelParameter [number].GetLength(0); i++) { for (int j = 0; j < LevelParameter [number].GetLength(1); j++) //每次都從第一個開始 一直跑到最後 { var mode = LevelParameter [number] [i, j, 0]; var map = CT1.Get_arrangement(LevelParameter [number] [i, j, 2]); random = LevelParameter [number] [i, j, 3]; CT1.useL1DB.random = random; yield return(StartCoroutine(LevelManagement(mode, Forward_OR_Reverse(ref dir, ref dirCount), map))); } } IEnumerator e = Loop3(Loop); yield return(StartCoroutine(e)); yield return(e.Current); //回傳至Loop1 }
///關卡設定 public override IEnumerator LevelManagement(params object[] args) { //旋轉模式 var mode = (int)args [0]; //旋轉方向(順或逆) var dir = (int)args [1]; //排列地圖 var maps = (List <Vector3>)args [2]; //更新難度條 CT1.DisplaySliderBar(); //創造旋轉群組 Level1_RotationFix RotateGroup = CT1.CreateGroup(); if (mode == 0) { RotateGroup.direction = dir; } //建置UFO位置 UFO.UFO_group = RotateGroup.transform; var Balance = maps.Count; //多(少)幾台 var Group = UFO.InstantiateUFOs(Balance); //實例化UFO //重設場上所有UFO座標 for (int i = 0; i < Group.Count; i++) { Group [i].moveTo(0.7f, maps [i], true, 0.1f); } yield break; }
public override void MAP() { CT1.useL1DB.map = Resources.LoadAll <TextAsset> ("JT/maps"); //讀入txt CT1.LoadMap(Resources.LoadAll <TextAsset> ("JT/maps") [2].text); }