Aleksandr Shetalin
Aleksandr Shetalin

Reputation: 11

Why, if in the debug mode you would pass through the line AudioSource.Play, playback does not start immediately after the line is executed?

Why, if in the debug mode you would pass through the line AudioSource.Play(); playback does not start immediately after the line is executed?

public AudioSource inactiveMusic;

void Start()
{
    inactiveMusic.Play();
}

But if the line AudioSource.Play() is written twice, then playback will start immediately after the execution of the second line:

public AudioSource inactiveMusic;

void Start()
{
    inactiveMusic.Play();
    inactiveMusic.Play();
}

Why the hell it is working like that? What's the logic?

Upvotes: 1

Views: 31

Answers (0)

Related Questions