Ejemplo n.º 1
0
    /// <summary>
    /// Restart the same song
    /// </summary>
    public void Retry()
    {
        Dictionary <string, string> par = new Dictionary <string, string> ()
        {
            { "path", path },
            { "resolution", SceneInfo.GetValueForKey("resolution") },
            { "speedMulti", SceneInfo.GetValueForKey("speedMulti") },
        };

        SceneInfo.SetParameters(par);
        SceneManager.LoadScene("Play");
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Setup background image and play the music
    /// </summary>
    public void SetDisplayAndPlay()
    {
        if (selectionObj.GetComponent <SelectionController> ().lastSelected != null &&
            selectionObj.GetComponent <SelectionController> ().lastSelected.GetInstanceID() == gameObject.GetInstanceID())
        {
            Dictionary <string, string> para = new Dictionary <string, string> ();
            para.Add("path", path);
            para.Add("resolution", resolution);
            para.Add("speedMulti", selectionObj.GetComponent <SelectionController>().speedMultiTxt.text);
            SceneInfo.SetParameters(para);
            SceneManager.LoadScene("Play");
        }
        selectionObj.GetComponent <SelectionController> ().lastSelected = gameObject;

        SetDisplay();
        PlayMusic();
    }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (audioSource.timeSamples == 0)
            {
                SceneManager.LoadScene("Selection");
            }
            else
            {
                PauseAndDisplayMenu();
            }
        }

        if (audioSource.isPlaying)
        {
            //RenderNotes();
        }
        else
        {
            if (!paused && played)
            {
                if (combo >= maxCombo)
                {
                    maxCombo = combo;
                }
                Dictionary <string, string> arg = new Dictionary <string, string> ()
                {
                    { "path", path },
                    { "perfect", perfect.ToString() },
                    { "good", good.ToString() },
                    { "bad", bad.ToString() },
                    { "miss", miss.ToString() },
                    { "score", score.ToString() },
                    { "combo", maxCombo.ToString() },
                    { "resolution", resolution.ToString() },
                    { "speedMulti", speedMulti.ToString() },
                };
                SceneInfo.SetParameters(arg);
                SceneManager.LoadScene("Score");
            }
        }
    }