public void LoadMainMenu() { ObstacleSpawner.StopSpawning(); ObstacleSpawner.DestroyAllObstacles(); playerController.SetVisible(false); playerController.transform.position = Vector3.zero; DisableUI(mainMenuUIGroup); DisableUI(gameUIGroup); EnableUI(mainMenuUI); }
//------------------------- public void StartNewGame() { DisableUI(mainMenuUIGroup); DisableUI(gameUIGroup); EnableUI(gameUI); playerController.SetVisible(false); playerController.transform.position = Vector3.zero; playerController.SetVisible(true); ObstacleSpawner.DestroyAllObstacles(); ObstacleSpawner.StartSpawning(); GameManager.ResetScore(); ObstacleSpawner.SetSpawnInterval(80f); PlayerController.SetAngularVelocity(10f); PlayerController.SetAngularVelocity(10f); PlayerController.SetForwardVelocity(20f); ObstacleSpawner.SetHoleMin(0.6f); ObstacleSpawner.SetHoleMax(0.8f); ObstacleBehaviour.SetRotationMultiplier(100f); ObstacleSpawner.Reset(); isGameRunning = true; }