- return¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢´Ø¿ôÆâ¤Î¤½¤ì°Ê¹ß¤Î½èÍý¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤¡£
- continue¤Ï¡¢²¼¤òÈô¤Ð¤·¤Æ°ìÈֶᤤfor¤ËÌá¤Ã¤Æ½èÍý¤ò·«¤êÊÖ¤¹
- break¤Ï¡¢°ìÈֶᤤ¥ë¡¼¥×½èÍý¤òÈ´¤±¤ë
private string test1 = "£±"; private string test2 = "£²"; private string test3 = "£³"; void Start () { for (int i = 0; i < 5; i++) { Debug.Log(test1); if (i == 2) { Debug.Log(test2); return; } Debug.Log(test3); } }
private string test1 = "£±"; private string test2 = "£²"; private string test3 = "£³"; void Start() { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Debug.Log(test1); if (j == 1) { Debug.Log(test2); return; } Debug.Log(test3); } } }
private string test1 = "£±"; private string test2 = "£²"; private string test3 = "£³"; private string testz = "£Ú"; void Start() { while (true) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Debug.Log(test1); if (j == 1) { Debug.Log(test2); return; } Debug.Log(test3); } } } Debug.Log(testz); }
private string test1 = "£±"; private string test2 = "£²"; private string test3 = "£³"; void Start() { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Debug.Log(test1); if (j == 1) { Debug.Log(test2); continue; } Debug.Log(test3); } } }
- ¥«¥Æ¥´¥ê¡§
- ¥Ñ¥½¥³¥ó
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯