Difficulty_Modifiers DifficultyToPlayerPref() { var maxNumberOfFigures = NumberOfFiguresSlider.value; var difficultyModifiers = new Difficulty_Modifiers { cardType = CardSizeDropdown.value == 0 ? Difficulty_Modifiers.CardType.Cart_Type12 : Difficulty_Modifiers.CardType.Cart_Type70 }; if (difficultyModifiers.cardType == Difficulty_Modifiers.CardType.Cart_Type12 && NumberOfFiguresSlider.value > 11) { maxNumberOfFigures = 11; } if (difficultyModifiers.cardType == Difficulty_Modifiers.CardType.Cart_Type70 && NumberOfFiguresSlider.value > 69) { maxNumberOfFigures = 69; } difficultyModifiers.Number_of_figures = int.Parse(maxNumberOfFigures.ToString()); difficultyModifiers.Number_of_mistakes = int.Parse(AllowedMistakesSlider.value.ToString()); difficultyModifiers.Colours_only_mechanic = ColorFilingDropdown.value == 0; difficultyModifiers.TimeRestriction = int.Parse(TimeRestrictionInputField.text); difficultyModifiers.Set_Figures_Colours(coloursList); difficultyModifiers.Card_pick_mechanic = CardChoosingDropdown.value == 0; ColourListToPlayerPrefs(); switch (GameModeDropdown.value) { case 0: difficultyModifiers.Game_mode = Difficulty_Modifiers.Game_Mode.Random; PlayerPrefs.SetInt("GameMode", 0); break; case 1: difficultyModifiers.Game_mode = Difficulty_Modifiers.Game_Mode.Assembling; PlayerPrefs.SetInt("GameMode", 1); break; default: difficultyModifiers.Game_mode = Difficulty_Modifiers.Game_Mode.Questions; PlayerPrefs.SetInt("GameMode", 2); break; } PlayerPrefs.SetString("CardType", difficultyModifiers.cardType.ToString()); PlayerPrefs.SetInt("NumberOfFigures", difficultyModifiers.Number_of_figures); PlayerPrefs.SetInt("NumberOfMistakes", difficultyModifiers.Number_of_mistakes); PlayerPrefs.SetInt("ColoursOnlyMechanic", difficultyModifiers.Colours_only_mechanic ? 0 : 1); PlayerPrefs.SetInt("TimeRestriction", int.Parse(TimeRestrictionInputField.text)); PlayerPrefs.SetInt("CardChoosing", difficultyModifiers.Card_pick_mechanic ? 0 : 1); return(difficultyModifiers); }
public void Generate_Card(Difficulty_Modifiers incoming_difficulty_modifires) { difficulty_modifires = incoming_difficulty_modifires; switch (difficulty_modifires.cardType) { case Difficulty_Modifiers.CardType.Cart_Type12: Generate_Card12(); break; case Difficulty_Modifiers.CardType.Cart_Type70: Generate_Card70(); break; default: Debug.Log("Error missing card type "); Debug.Log(difficulty_modifires.cardType); break; } }