using UnityEngine;
using System.Collections;
public class Love : MonoBehaviour {
// Use this for initialization
void Start () {
//沿著愛心逆時針順序跑
// A C
for (int i=1; i<=4 ; i++ )
{
//B
Debug.Log ("for情書傳給第"+i+"位同學");
//B
}
//=============================
int w = 1;
while (w<=4)
{
Debug.Log ( "while情書傳給第" + w + "位同學" );
w++;
}
//=============================
int d = 1;
do
{
Debug.Log ( "do while情書傳給第" + d + "位同學" );
d++;
}
while (d<=4);
}
// Update is called once per frame
void Update () {
}
}
2016年10月18日 星期二
Unity C# 程式心得分享 for迴圈 while迴圈 loop
訂閱:
張貼留言 (Atom)
非常喜欢你的教程!
回覆刪除