Exemple #1
0
    public void DestroyEverything()
    {
        OrchestraPrefab.Reset();
        _sliders.Clear();

        foreach (var source in _sources)
        {
            Destroy(source.Value.gameObject);
        }
        _sources.Clear();

        foreach (var button in GameObject.FindGameObjectsWithTag("trackButton"))
        {
            Destroy(button);
        }
        foreach (var slider in GameObject.FindGameObjectsWithTag("trackVolume"))
        {
            Destroy(slider);
        }
        foreach (var audio in GameObject.FindGameObjectsWithTag("trackAudio"))
        {
            Destroy(audio);
        }
        foreach (var score in GameObject.FindGameObjectsWithTag("Score"))
        {
            Destroy(score);
        }
    }