Beispiel #1
0
    // We make sure this object do not vanishes in loadscenes
    // If our protected static instance variable isn't ready we destroy this one and return the existing one.
    void Awake()
    {
        if (_instance == null)
        {
            DontDestroyOnLoad(gameObject);
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(gameObject);
        }

        _sceneLoader = transform.GetComponent <SceneLoader>();

        _dataController = new GameDataController();
        _dataController.Load(_stageNames);
        _stages = Stages.BuildStages(_stageNames, _dataController.GetDataInfo());

        SetupSoundAndMusicManager();

        _device = new DeviceController();

        // if tablet use "fastest" quality (Index 0);
        if (_device.isTablet())
        {
            QualitySettings.SetQualityLevel(0);
        }
    }
Beispiel #2
0
 public void RefreshStages()
 {
     _stages = Stages.BuildStages(_stageNames, _dataController.GetDataInfo());
 }