Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        musicManager = FindObjectOfType <MusicManager>();
        if (!musicManager)
        {
            Debug.LogWarning("MusicManager not found");
        }

        musicVolumeSlider.value = PPrefsMgr.GetMusicVolume();
        sfxVolumeSlider.value   = PPrefsMgr.GetSfxVolumeFromDisk();
        difficultySlider.value  = PPrefsMgr.GetDifficulty();
    }
Ejemplo n.º 2
0
    void Start()
    {
        if (autoLoadNextLevelDelay > 0) // probably only used for the splash screen
        {
            Invoke("LoadNextLevel", autoLoadNextLevelDelay);
        }

        Debug.Log("******* Level " + GetLevelName() + " *******");
        thisLevel = (LEVELS)SceneManager.GetActiveScene().buildIndex;

        // initial sfx volume from disk
        if (!sfxVolumeInitialized)
        {
            PPrefsMgr.GetSfxVolumeFromDisk();
            sfxVolumeInitialized = true;
        }

        GameObject text = GameObject.Find("LevelName");

        if (text)
        {
            text.GetComponent <Text>().text = GetLevelName();
        }
        else if (IsLevel())
        {
            Debug.LogWarning("no LevelName text gameobject found in canvas");
        }

        StartByLevel();

        GameObject gO = GameObject.Find("AudioAmbient");

        if (gO)
        {
            Debug.LogError("Level " + GetLevelName() + ": AudioAmbient gameobject found, remove from this level");
        }

        //Debug.Log(GetLevelName());
    }