Skip to main content
Tweeted twitter.com/StackGameDev/status/1267244534980907009
clarified question
Link
user1430
user1430

How are methods like Awake, Start, and Update called in Unity?

How are methodesmethods like Awake, Start, and Update called in Unity?

II'm developing with Unity 5 and I know that there are some methodesmethods you can use like in the code below:

public class MyGameElement : MonoBehaviour 
{
    private void Awake() { }
    private void Start() { }
    private void Update() { }
    private void FixedUpdate() { }
    // and more
}

I know what they do but I find it strange that the methods can be private. However therethey are not called into my code I've writewritten. Here you've an image with code lens (I use VS 2015 Professional for coding) where you can relayreally see that it has zero references.

0 references: private void awake / 0 references private void FixedUpdate

The second 'strange' thing for me is that the methods aren't overwritten.

So my question is now is there anything that Unity go add or donehas implemented into the MonoBehaviour class that the methods can call?

How are methodes like Awake, Start and Update called in Unity?

I developing with Unity 5 and I know that there are some methodes you can use like code below:

public class MyGameElement : MonoBehaviour 
{
    private void Awake() { }
    private void Start() { }
    private void Update() { }
    private void FixedUpdate() { }
    // and more
}

I know what they do but I find it strange that the methods can be private. However there are not called into my code I've write. Here you've an image with code lens (I use VS 2015 Professional for coding) where you can relay see that it has zero references.

0 references: private void awake / 0 references private void FixedUpdate

The second 'strange' thing for me is that the methods aren't overwritten.

So my question is now is there anything that Unity go add or done into the MonoBehaviour class that the methods can call?

How are methods like Awake, Start, and Update called?

I'm developing with Unity 5 and I know that there are some methods you can use like in the code below:

public class MyGameElement : MonoBehaviour 
{
    private void Awake() { }
    private void Start() { }
    private void Update() { }
    private void FixedUpdate() { }
    // and more
}

I know what they do but I find it strange that the methods can be private. However they are not called into my code I've written. Here you've an image with code lens (I use VS 2015 Professional for coding) where you can really see that it has zero references.

0 references: private void awake / 0 references private void FixedUpdate

The second 'strange' thing for me is that the methods aren't overwritten.

So my question is now is there anything that Unity has implemented into the MonoBehaviour class that the methods can call?

Source Link
H. Pauwelyn
  • 805
  • 5
  • 17
  • 31

How are methodes like Awake, Start and Update called in Unity?

I developing with Unity 5 and I know that there are some methodes you can use like code below:

public class MyGameElement : MonoBehaviour 
{
    private void Awake() { }
    private void Start() { }
    private void Update() { }
    private void FixedUpdate() { }
    // and more
}

I know what they do but I find it strange that the methods can be private. However there are not called into my code I've write. Here you've an image with code lens (I use VS 2015 Professional for coding) where you can relay see that it has zero references.

0 references: private void awake / 0 references private void FixedUpdate

The second 'strange' thing for me is that the methods aren't overwritten.

So my question is now is there anything that Unity go add or done into the MonoBehaviour class that the methods can call?