void Awake() { if (RESET) { PlayerPrefs.DeleteAll(); } #if UNITY_ANDROID // isAndroid = true; #endif // Cursor.visible = false; if (FORCE_LOCAL_SCORE > 0) { PlayerPrefs.SetInt("scoreLevel_1", FORCE_LOCAL_SCORE); } if (!mInstance) { mInstance = this; } else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this); if (LevelDataDebug.Instance) { playMode = PlayModes.STORYMODE; DEBUG = LevelDataDebug.Instance.isDebbug; this.isArcadeMultiplayer = LevelDataDebug.Instance.isArcadeMultiplayer; this.playOnlyBosses = LevelDataDebug.Instance.playOnlyBosses; this.playMode = LevelDataDebug.Instance.playMode; this.forceVideogameID = LevelDataDebug.Instance.videogameID; this.forceMissionID = LevelDataDebug.Instance.missionID; this.testAreaName = LevelDataDebug.Instance.testArea; } events = GetComponent <Events>(); missions = GetComponent <Missions>(); multiplayerData = GetComponent <MultiplayerData>(); videogamesData = GetComponent <VideogamesData> (); inputSaver = GetComponent <InputSaver> (); inputSavedAutomaticPlay = GetComponent <InputSavedAutomaticPlay> (); versusManager = GetComponent <VersusManager> (); handWriting = GetComponent <HandWriting> (); texts = GetComponent <Texts> (); // GetComponent<Tracker>().Init(); GetComponent <CurvedWorldManager>().Init(); voicesManager.Init(); events.SetVolume += SetVolume; }
void Awake() { Random.seed = 42; if (RESET) { PlayerPrefs.DeleteAll(); } // Cursor.visible = false; if (FORCE_LOCAL_SCORE > 0) { PlayerPrefs.SetInt("scoreLevel_1", FORCE_LOCAL_SCORE); } mInstance = this; DontDestroyOnLoad(this); //setAvatarUpgrades(); // levelUnlockedID = PlayerPrefs.GetInt("levelUnlocked_0"); events = GetComponent <Events>(); missions = GetComponent <Missions>(); competitions = GetComponent <Competitions>(); multiplayerData = GetComponent <MultiplayerData>(); videogamesData = GetComponent <VideogamesData> (); inputSaver = GetComponent <InputSaver> (); inputSavedAutomaticPlay = GetComponent <InputSavedAutomaticPlay> (); versusManager = GetComponent <VersusManager> (); if (totalJoysticks > 0) { multiplayerData.player1 = true; } if (totalJoysticks > 1) { multiplayerData.player2 = true; } if (totalJoysticks > 2) { multiplayerData.player3 = true; } if (totalJoysticks > 3) { multiplayerData.player4 = true; } // competitions.Init(); if (userData) { userData.Init(); } GetComponent <Tracker>().Init(); GetComponent <Missions>().Init(); GetComponent <CurvedWorldManager>().Init(); // GetComponent<DataController>().Init(); //levelUnlocked_level_1 = PlayerPrefs.GetInt("levelUnlocked_level_1"); //levelUnlocked_level_2 = PlayerPrefs.GetInt("levelUnlocked_level_2"); levelUnlocked_level_1 = 100; levelUnlocked_level_2 = 100; voicesManager.Init(); events.SetVolume += SetVolume; }