This is for unity
I tried another way of stopping player after he dies and it worked fine but now it does not work with sounds
That was my way the only thing that I changed is the state
Ben's was
if (state == state.Alive) { Update() }
Mine was
if (state == state.Dying) { return; }
They look the same but the problem is the Success Sound will not play
Ben's code is working fine with me but I want to understand how it works
is mine the same?
void Update()
{
if (state == State.Dying)
{
return;
}
Rotate();
Thrust();
}
Ben's way
void Update()
{
if (state == State.Alive)
{
Rotate();
Thrust();
}
}
For People Asking For The Enum Definitions:
enum State { Alive, Dying, Transcending }
State state = State.Alive;