public void StartGame() { currentStep_ = 0; currentStepState_ = STEPSTATE.STARTSCREEN; mistakes_ = 0; camera_.GotoPosition(stepLocations_[0], stepRotations_[0]); }
private void StartStepUpdate() { if (Input.GetMouseButtonDown(0)) { activeInteractables_.Clear(); for (int i = 0; i < stepInteractables_[currentStep_].Count; i++) { activeInteractables_.Add(interactables_[stepInteractables_[currentStep_][i]]); interactables_[stepInteractables_[currentStep_][i]].EnterWorkArea(); } camera_.GotoPosition(stepLocations_[1], stepRotations_[1]); currentStepState_ = STEPSTATE.TRANSITIONINGTOWORKING; } }
public void EndStep() { if (currentAppState_ == APPSTATE.PLAYING) { currentStep_++; for (int i = 0; i < activeInteractables_.Count; i++) { activeInteractables_[i].ExitWorkArea(); } if (currentStep_ >= totalSteps_) { EndGame(); } else { camera_.GotoPosition(stepLocations_[0], stepRotations_[0]); currentStepState_ = STEPSTATE.TRANSITIONINGTOSTART; } } }
// Update is called once per frame void Update() { // if the game is playing if (currentAppState_ == APPSTATE.PLAYING) { // goto update method for current game state switch (currentStepState_) { case STEPSTATE.STARTSCREEN: StartStepUpdate(); break; case STEPSTATE.WORKING: StepUpdate(); break; case STEPSTATE.TRANSITIONINGTOSTART: if (camera_.FinishedMove()) { currentStepState_ = STEPSTATE.STARTSCREEN; } break; case STEPSTATE.TRANSITIONINGTOWORKING: if (camera_.FinishedMove()) { currentStepState_ = STEPSTATE.WORKING; } break; } } // else if (currentAppState_ == APPSTATE.MAINMENU) { } }