Пример #1
0
    public void bakc_to_menu()
    {
        DisableLayers();
        VrstvaStart.SetActive(true);
        ScoreText.text = 0.ToString();
        Hra.hrac.transform.position      = new Vector3(-5f, 2.5f, -1f);
        Hra.hracvcela.transform.position = new Vector3(-5f, 2.5f, -1f);
        hrac.gameObject.GetComponent <Rigidbody2D>().simulated = true;
        hrac_vcela_skript.gameObject.GetComponent <Rigidbody2D>().simulated = true;
        Hra.enabled = true;
        Hra.pozadie1.transform.position  = new Vector3(4f, 0f, 0f);
        Hra.pozadie2.transform.position  = new Vector3(30f, 0f, 0f);
        Hra.pozadie3.transform.position  = new Vector3(3f, 0f, 0f);
        Hra.pozadie4.transform.position  = new Vector3(25.89f, 0f, 0f);
        Hra.pozadie5.transform.position  = new Vector3(6f, 0f, 0f);
        Hra.pozadie6.transform.position  = new Vector3(34.23f, 0f, 0f);
        Hra.pozadie7.transform.position  = new Vector3(0.5f, 0f, 0f);
        Hra.pozadie8.transform.position  = new Vector3(17.82f, 0f, 0f);
        Hra.vzdialenostOdPoslednejPipeky = 0;
        Hra.posunutie   = 0;
        Hra.pocet_pipok = 0;
        Hra.score       = 0;

        foreach (GameObject pipeka in Hra.Pipeky)
        {
            Destroy(pipeka);
        }
        Hra.Pipeky.Clear();
        Hra.Pipeky.Clear();
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()

    {
        DisableLayers();
        VrstvaStart.SetActive(true);
        ScoreText.text = 0.ToString();
        Hra.hrac.transform.position      = new Vector3(-5f, 2.5f, -1f);
        Hra.hracvcela.transform.position = new Vector3(-5f, 2.5f, -1f);
        hrac.gameObject.GetComponent <Rigidbody2D>().simulated = true;
        hrac_vcela_skript.gameObject.GetComponent <Rigidbody2D>().simulated = true;
        Hra.enabled = true;
        Hra.pozadie1.transform.position  = new Vector3(4f, 0f, 0f);
        Hra.pozadie2.transform.position  = new Vector3(30f, 0f, 0f);
        Hra.pozadie3.transform.position  = new Vector3(3f, 0f, 0f);
        Hra.pozadie4.transform.position  = new Vector3(25.89f, 0f, 0f);
        Hra.pozadie5.transform.position  = new Vector3(6f, 0f, 0f);
        Hra.pozadie6.transform.position  = new Vector3(34.23f, 0f, 0f);
        Hra.pozadie7.transform.position  = new Vector3(0.5f, 0f, 0f);
        Hra.pozadie8.transform.position  = new Vector3(17.82f, 0f, 0f);
        Hra.vzdialenostOdPoslednejPipeky = 0;
        Hra.posunutie   = 0;
        Hra.pocet_pipok = 0;
        Hra.score       = 0;
        Hra.typPozadia  = 1;
        obdlznik1.SetActive(true);
        obdlznik2.SetActive(false);
        obdlznik3.SetActive(false);
        obdlznik4.SetActive(false);
        obdlznik_motyl.SetActive(true);
        obdlznik_vcela.SetActive(false);
    }