Esempio n. 1
0
    public void ResetGame()
    {
        gameState = GameState.ReadyToStart;

        UIManager.HideGameOverPanel();
        UIManager.ShowStartLabel();

        platformsJumped = 0;
        timePassed      = 0;

        if (envController != null)
        {
            Destroy(envController.gameObject);
        }

        var env = Instantiate(environmentPrefab, Vector3.zero, Quaternion.identity);

        envController = env.GetComponent <EnvironmentController>();

        var plyr = Instantiate(playerPrefab, playerInitPos.position, Quaternion.identity);

        player = plyr.GetComponent <Player_Controller>();
        vfxManager.PlayerSpawnVFX(playerInitPos.position);
    }