bool isCollisionEnabled = true;
void Update()
{
if(state == State.Alive)
{
RespondToThrustInput();
RespondToRotationInput();
RespondToDebugKeys();
}
}
void RespondToDebugKeys()
{
//Wins the level upon pressing the L key
if (Input.GetKeyDown(KeyCode.L))
{
StartSuccessSequence();
}
//Changes the collision parameter between 0 and 1, preventing the game from doing anything (including winning) upon collision when the value is 0.
if (Input.GetKeyDown(KeyCode.C))
{
isCollisionEnabled = !isCollisionEnabled;
}
}
I think my solution is pretty unique, as i didn’t find others using StartSuccessSequence …it is slower though.