private void TriggerTutorial(lvlType lvl) { switch (lvl) { case lvlType.normal: normalModeTut.tutCont.SetActive(true); normalModeTut.tut.StartTutorial(); break; case lvlType.simon: break; case lvlType.cascada: break; case lvlType.frenesi: break; case lvlType.bonus: break; default: ShowNormalLoadingScreen(); break; } }
public void SaveLvlByMode(lvlType lvlType, int currLvl) { string saveKey = lvlType.ToString() + lvlSuffix; if (currLvl < 1) { currLvl = 1; } PlayerPrefs.SetInt(saveKey, currLvl); PlayerPrefs.Save(); }
private LevelInfo GetLvlFromListByType(lvlType lvlTypeEnum) { foreach (var t in lvlsList) { if (t.lvlTypeInfo.lvlType == lvlTypeEnum) { return(t); } } return(lvlsList[0]); }
public void TryTriggerTutorial(lvlType lvl) { int lvlInType = SerializationManager.instance.LoadLvlByMode(lvl); if (lvlInType <= 1) { TriggerTutorial(lvl); } else { ShowNormalLoadingScreen(); OnCompleteCurrentTutorial(); } }
public int LoadLvlByMode(lvlType lvlType) { int lvl = 1; string saveKey = lvlType.ToString() + lvlSuffix; if (PlayerPrefs.HasKey(saveKey)) { lvl = PlayerPrefs.GetInt(saveKey); } if (lvl < 1) { lvl = 1; } return(lvl); }
void Update() { movement = true; currentScene = SceneManager.GetActiveScene().name; if (playerScript != null) { currentPlayerPos = playerScript.playerTrans.transform.position; } if (Input.GetKeyDown(KeyCode.Escape)) { if ((!pause) && (lvl != lvlType.MAINMENU)) { pauseGame(); } } if (currentScene == "MainMenu") { lvl = lvlType.MAINMENU; movement = false; } if (currentScene == "Combat") { lvl = lvlType.COMBAT; movement = false; } if (currentScene.IndexOf("Town") > -1 || currentScene.IndexOf("town") > -1) { lvl = lvlType.TOWN; movement = true; } if (currentScene.IndexOf("House") > -1 || currentScene.IndexOf("house") > -1) { lvl = lvlType.HOUSE; movement = true; } if ((lvl == lvlType.TOWN) && combatTimer) { combatStart(); } }
public void SetSimonGameMode() { currentGameMode = lvlType.simon; lvl_Index = SerializationManager.instance.LoadLvlByMode(currentGameMode); }
public void SetNormalGameMode() { currentGameMode = lvlType.normal; lvl_Index = SerializationManager.instance.LoadLvlByMode(currentGameMode); }
public void SetLastPlayedMode() { currentGameMode = SerializationManager.instance.LoadLastGameModePlayed(); lvl_Index = SerializationManager.instance.LoadLvlByMode(currentGameMode); }
//TO DO: //Set a structure to fill up the end panels. #endregion #region Lvl Management public void SetGameMode(lvlType type) //Unused { currentGameMode = type; }
public void SaveLastGameModePlayed(lvlType lvlPlayed) { PlayerPrefs.SetString(lastPlayedMode, lvlPlayed.ToString()); PlayerPrefs.Save(); }