When I did the challenge for this lecture I put the isTransitioning = true
within my switch vs within the method the switch case is calling (like Rick did in the video). Is there a reason to do this in the method vs within the switch? Both work.
Example:
void OnCollisionEnter(Collision other)
{
if (!isTransitioning)
{
switch (other.gameObject.tag)
{
case "Friendly":
break;
case "Finish":
StartSuccessSequence();
isTransitioning = true;
break;
default:
StartCrashSequence();
isTransitioning = true;
break;
}
}
}