Unity3D.tips[0]: Avoid naming your MonoBehaviour methods Main()

Try to avoid naming your MonoBehaviour methods Main(). These would be triggered between Awake() and Start(). This Main() method supports IEnumerator flavors as much as Awake() and alike! But as useful as it could be, I would not recommend to use it as there is no official documentation entry in the manual. And usually, you should not need this method.

Évitez de nommer Main() les méthodes se situant dans vos MonoBehaviour. Celles-ci seraient déclenchées entre Awake() et Start(). Cette méthode Main() supporte la version en IEnumerator autant que Awake() et les autres ! Mais aussi utile que pourrait être cette méthode, je ne la recommanderais pas à l’usage puisqu’il n’existe aucune documentation officielle dans le manuel. Et normalement, vous ne devriez pas avoir recours à cette méthode.

Screenshot of Unity console
Awake() is fired, then Main() and finally Start(). But don’t use Main()!

Published by Dakwamine

Dakwamine, alias Quang-Minh Dang, né en 1987 en région parisienne. Un type sympa, pas bavard et pragmatique.