public bool startPlaneSequence() { if (solveTryAttempts > 0 && planeSequenceStatus == PlaneSequenceStatus.Idle && xPlaneBehaviour.planeStatus == PlaneStatus.Idle && zPlaneBehaviour.planeStatus == PlaneStatus.Idle ) { planeSequenceStatus = PlaneSequenceStatus.MovingX; return(true); } return(false); }
private void handlePlaneSequence() { if (planeSequenceStatus >= PlaneSequenceStatus.Ended) { if (planeSequenceStatus == PlaneSequenceStatus.Ended) { // TODO: This has to be uncomment so the codes works again //endCurrentLevel(); } else { solveTryAttempts--; Debug.Log("Lose!"); resultText.text = "Lose!"; } planeSequenceStatus = PlaneSequenceStatus.Idle; issueMovePlane = false; if (solveTryAttempts > 0 && this.uiController) { this.uiController.toggleSolveButton(true); this.uiController.toggleTransformButtons(true); } else { LevelController.Instance.Lose(); } } if (planeSequenceStatus > PlaneSequenceStatus.Idle && planeSequenceStatus < PlaneSequenceStatus.Ended) { if (planeSequenceStatus == PlaneSequenceStatus.MovingX) { if (xPlaneBehaviour.planeStatus == PlaneStatus.Idle) { if (!issueMovePlane) { issueMovePlane = true; xPlaneBehaviour.planeStatus = PlaneStatus.Move; } } else if (xPlaneBehaviour.planeStatus == PlaneStatus.Ended) { issueMovePlane = false; planeSequenceStatus = PlaneSequenceStatus.MovingZ; } } if (planeSequenceStatus == PlaneSequenceStatus.MovingZ) { if (zPlaneBehaviour.planeStatus == PlaneStatus.Idle) { if (!issueMovePlane) { issueMovePlane = true; zPlaneBehaviour.planeStatus = PlaneStatus.Move; } } else if (zPlaneBehaviour.planeStatus == PlaneStatus.Ended) { issueMovePlane = false; planeSequenceStatus = PlaneSequenceStatus.Ended; } } } }