Exemple #1
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            Application.targetFrameRate = 60;

            DontDestroyOnLoad(gameObject);
            inInverseAnimation = false;
            OnSetPause(false);
            popupIsOnScreen = false;

            //Create Worlds
            worldList_par.Add(LevelsList_w1_par);
            worldList_par.Add(LevelsList_w2_par);
            worldList_par.Add(LevelsList_w3_par);
            worldList_par.Add(LevelsList_w4_par);
            worldList_par.Add(LevelsList_w5_par);
            worldList_par.Add(LevelsList_w6_par);
            LoadLevelsFromSave();
            if (SceneManager.GetActiveScene() != SceneManager.GetSceneAt(0))
            {
                UpdateBackgroundColor();
            }

            //Activate GooglePlay Services
            _GPSHelper = gameObject.AddComponent <GooglePlayServiceHelper>();

            StartCoroutine(UpdateAudioGroupsOnDelay(0f));
        }
        else
        {
            Destroy(gameObject);
        }
    }
Exemple #2
0
    void Awake()
    {
        if (Instance == null) {
            Instance = this;
            Application.targetFrameRate = 60;

            DontDestroyOnLoad(gameObject);
            inInverseAnimation = false;
            OnSetPause(false);
            popupIsOnScreen = false;

            //Create Worlds
            worldList_par.Add(LevelsList_w1_par);
            worldList_par.Add(LevelsList_w2_par);
            worldList_par.Add(LevelsList_w3_par);
            worldList_par.Add(LevelsList_w4_par);
            worldList_par.Add(LevelsList_w5_par);
            worldList_par.Add(LevelsList_w6_par);
            LoadLevelsFromSave();
            if (SceneManager.GetActiveScene() != SceneManager.GetSceneAt(0)) UpdateBackgroundColor();

            //Activate GooglePlay Services
            _GPSHelper = gameObject.AddComponent<GooglePlayServiceHelper>();

            StartCoroutine(UpdateAudioGroupsOnDelay(0f));
        } else {
            Destroy(gameObject);
        }
    }