示例#1
0
    void Awake()
    {
        //Application.targetFrameRate = 30;
        Screen.SetResolution(1080, 1920, true);
        //Application.targetFrameRate = 60;
        //QualitySettings.vSyncCount = 0;
        cam = Camera.Instantiate(mainCamera);

        playerDataController = transform.GetComponent <PlayerDataController>();
        playerDataController.LoadPlayerData();
        Debug.Log(playerDataController.playerData.lastLevel);
        dataController = transform.GetComponent <DataController>();
        dataController.LoadGameData();
        gameState = _state.intro;
        Object.DontDestroyOnLoad(transform);
        Object.DontDestroyOnLoad(cam);
        soundController  = GetComponent <SoundController>();
        musicController  = GetComponent <MusicController>();
        pauseMenuEnabled = true;
        paused           = false;
        helperEnabled    = true;
        if (playerDataController.playerData.sfxOnOff == 1)
        {
            soundController.SoundFXOn = true;
        }
        else
        {
            soundController.SoundFXOn = false;
        }
        if (playerDataController.playerData.musicOnOff == 1)
        {
            musicController.MusicOn = true;
        }
        else
        {
            musicController.MusicOn = false;
        }
    }