yield or yield new?

I saw people sporadically using “yield ” and “yield new ”. Is there a specific reason one is used in certain situations over others because I could not see one.

My understanding is that “yield WaitForSeconds(1)” uses a static function to generate a class whilst “yield new WaitForSeconds(1)” simply generates the new class.

  • Hoa

I think you use yield for javascript and yield return new for c#.

They’re the same; “new” is an optional keyword in Unity JavaScript.