I understand that the if should be set in order to produce sound after mouse button clicked. But I am confused about the value in boolean hasStarted in different stages.
The lecture said that if the hasStarted equals to true, then play the sound. Which means the sound would play once the method LaunchOnMouseClick is run and the mouse left button is clicked, so the value of hadStarted becomes true.
but hadStarted we set equals to false initailly. Therefore, in the method OnCollisionEnter2D, how could if (hasStarted) equals if (hasStarted == true)?
Sorry that I may explain the situation badly. But I am really curious about this. Thanks