Ejemplo n.º 1
0
    // Score type text
    void SpawnFloatingText(string scoreTypeCount)
    {
        ClearFloatingText();

        switch (scoreTypeCount)
        {
        case Constants.perfects:
            floatingTexts.Add(canvasObjectPooler.SpawnFromPool(Constants.perfectText, new Vector3(gameCanvas.position.x, gameCanvas.position.y - 150.0f, gameCanvas.position.z), Quaternion.identity));
            break;

        case Constants.greats:
            floatingTexts.Add(canvasObjectPooler.SpawnFromPool(Constants.greatText, new Vector3(gameCanvas.position.x, gameCanvas.position.y - 150.0f, gameCanvas.position.z), Quaternion.identity));
            break;

        case Constants.goods:
            floatingTexts.Add(canvasObjectPooler.SpawnFromPool(Constants.goodText, new Vector3(gameCanvas.position.x, gameCanvas.position.y - 150.0f, gameCanvas.position.z), Quaternion.identity));
            break;

        case Constants.bads:
            floatingTexts.Add(canvasObjectPooler.SpawnFromPool(Constants.badText, new Vector3(gameCanvas.position.x, gameCanvas.position.y - 150.0f, gameCanvas.position.z), Quaternion.identity));
            break;

        case Constants.misses:
            floatingTexts.Add(canvasObjectPooler.SpawnFromPool(Constants.missText, new Vector3(gameCanvas.position.x, gameCanvas.position.y - 150.0f, gameCanvas.position.z), Quaternion.identity));
            break;
        }
    }
Ejemplo n.º 2
0
    // Resume game after 3s countdown
    public IEnumerator CountdownResume()
    {
        canvasObjectPooler.SpawnFromPool(Constants.countdownText3, new Vector3(gameCanvas.position.x, gameCanvas.position.y + 100.0f, gameCanvas.position.z), Quaternion.identity);
        yield return(new WaitForSeconds(1));

        canvasObjectPooler.SpawnFromPool(Constants.countdownText2, new Vector3(gameCanvas.position.x, gameCanvas.position.y + 100.0f, gameCanvas.position.z), Quaternion.identity);
        yield return(new WaitForSeconds(1));

        canvasObjectPooler.SpawnFromPool(Constants.countdownText1, new Vector3(gameCanvas.position.x, gameCanvas.position.y + 100.0f, gameCanvas.position.z), Quaternion.identity);
        yield return(new WaitForSeconds(1));

        isPaused            = false;
        AudioListener.pause = false;
        audioManager.Play(PlayerPrefs.GetString(Constants.selectedSong));
        pauseButton.SetActive(true);
    }