// Update is called once per frame void Update() { switch (state) { //No panel is activated case 0: //checks if the player stept on the first trigger and sets the state to 1 if (button1.trigger == true) { state = 1; } break; case 1: //checks if the player stept on the second trigger and sets the state to 2 if (button2.trigger == true) { state = 2; } //checks if the player stept on the third trigger instead of the second one, if so it sets the state back to 0 else if (button3.trigger == true) { state = 0; } break; case 2: //checks if the player stept on the third trigger and sets the state to 3 if (button3.trigger == true) { state = 3; } //checks if the player stept on the first panel and sets the state back to 0 else if (button1.trigger == true) { state = 0; } break; case 3: //when the triggers are triggered in the right order the door moves away doormoving.startMove(); break; default: break; } }
// Update is called once per frame void Update() { switch (state) { //No panel is activated case 0: //checks if the player stept on the first trigger and sets the state to 1 if (trigger.trigger == true) { state = 1; } break; case 1: //when the triggers are triggered in the right order the door moves away doormoving.startMove(); break; } }