Skip to main content

Why does Unity usesuse reflection to get the update method?

Why does Unity usesuse reflection in order access to access MonoBehaviour messagesmessage methods like Awake, Update, Start,...?

Wouldn't it be slow to use reflection? Why it doesn't it leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviourMonoBehaviour base class and force the subclasses to implement it.

Why Unity uses reflection to get the update method?

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

Why does Unity use reflection to get the update method?

Why does Unity use reflection in order to access MonoBehaviour message methods like Awake, Update, Start,...?

Wouldn't it be slow to use reflection? Why doesn't it leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

Tweeted twitter.com/StackGameDev/status/1056878445647552514
Rollback to Revision 1
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

So as you see in the answer my assumption was wrong. However, the answer can be useful for users hence I kept the post.

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

So as you see in the answer my assumption was wrong. However, the answer can be useful for users hence I kept the post.

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

added 117 characters in body
Source Link
Emad
  • 1.1k
  • 2
  • 14
  • 22

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

So as you see in the answer my assumption was wrong. However, the answer can be useful for users hence I kept the post.

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

Why Unity uses reflection in order access to MonoBehaviour messages methods like Awake, Update, Start,...?

Wouldn't be slow to use reflection? Why it doesn't leverage other approaches like Template Method? It could simply define the methods as abstract in MonoBehaviour base class and force the subclasses to implement it.

So as you see in the answer my assumption was wrong. However, the answer can be useful for users hence I kept the post.

Source Link
Emad
  • 1.1k
  • 2
  • 14
  • 22
Loading