public void SuperFinish() { Canvaser.Instance.SetGameOverPanel(); IceCreamRotator.SetRotator(false); Speed.z = 0; SpeedMultiplyer = 0; Started = false; Paused = false; CanUseCurrentBonus = true; CameraFollow.Instance.ChangeCamera(); PlayerController.Instance.PlayerAnimator.SetTrigger("Change"); PlayerController.Instance.animator.SetBool(PlayerController.StartedHash, false); Time.timeScale = 1; AchievementsManager.Instance.CheckAchievements(TasksTypes.Loose); ScoreManager.Instance.SubmitScoreAsync((int)CurrentPoints, CurrentCoins, CurrentBoxes); TouchReader.ClearInputs(); if (InDuel) { DuelManager.Instance.SubmitDuelResultAsync(DuelID, (int)CurrentPoints); InDuel = false; } Canvaser.Instance.PausePanel.SetActive(false); Canvaser.Instance.GamePanel.gameObject.SetActive(false); Canvaser.Instance.Coins.text = "0"; Canvaser.Instance.Score.text = "0"; AchievementsManager.Instance.SubmitAllAchievements(true); TasksManager.Instance.SubmitAllTasks(true); TurnOffAllBonuses(); PlayerController.Instance.ResetSas(); CoinGenerator.Instance.TurnOffCoins(); MapGenerator.Instance.StartGeneration(); }
public void StartGeneration() { ResetTiles(); Tile tempLast = null; for (int i = 0; i < StartTilesNumber; i++) { Tile _currentNewTile = null; if (_lastTile) { var inactiveTiles = _lastTile.InactiveTiles; if (inactiveTiles.Count > 0) { var number = Random.Range(0, inactiveTiles.Count); _currentNewTile = inactiveTiles[number]; } } if (!_currentNewTile) { var number = Random.Range(0, _avaliableTiles.Count); _currentNewTile = _avaliableTiles[number]; } _currentNewTile.gameObject.SetActive(true); _currentNewTile.EnableObstcles(); _currentNewTile.EnableIceCreams(); if (_lastTile) { _currentNewTile.transform.localPosition = _lastTile.transform.localPosition - Vector3.forward * TileSize * TileScale; } _lastTile = _currentNewTile; _avaliableTiles.Remove(_currentNewTile); if (i != 0) { _lastTile.Generated = true; } else { tempLast = _lastTile; } } StartTile.gameObject.SetActive(true); StartTile.transform.position = _lastTile.transform.position - Vector3.forward * TileSize * transform.localScale.z; StartTile.EnableObstcles(); _lastTile = tempLast; IceCreamRotator.SetRotator(true); }