A question about IEnumerator

Hi,

I’m a begineer, there is a puzzle to me. please see below:

style1: void Update () {
transform.Translate(Vector3.forwardspeedTime.deltaTime);
}

style2: void Start(){
StartCoroutine(forward());
}

IEnumerator forward() {
while(true){
transform.Translate(Vector3.forwardspeedTime.deltaTime);
yield return null;
}
}

Is there something difference between these two style?

The 2nd method runs in parallel to your main update loops. The yields in it are set to delay minimally, so that loop will move your object far more quickly.

That is not true! Coroutines do not run in parallel. They are executed after Update.
http://docs.unity3d.com/Documentation/Manual/ExecutionOrder.html

In this example, they are identical.

Another difference to watch for with coroutines:
If the game object is ever disabled, the Coroutine will be killed. If the game object is then re-enabled, the Coroutine will not resume unless you start it up again manually. That would not be an issue when moving the object within Update().