public static void Reload() { if (SerializationSystem.GetValue <int>("highScore.json") < score) { SerializationSystem.SaveValue(score); highScore = score; } score = 0; isBirdFly = false; isGameWaiting = true; scoreLabel.GetComponent().GetFontComponent().SetText(score.ToString()); highScoreLabel.GetComponent().GetFontComponent().SetText(highScore.ToString()); textLabel.GetComponent().GetFontComponent().SetText("Tap on space to play game"); }
private void Awake() { SerializationSystem.PathToProperties = Application.persistentDataPath; PlayerProperties = SerializationSystem.Load <Properties>(); OnPlayerPropertiesLoaded?.Invoke(); SetBackgroundBlur(); SerializationSystem.Save(PlayerProperties); IsCanSave = true; ExperienceSlider.maxValue = GetExpForNextLVL(PlayerProperties.Level); ExperienceSlider.value = PlayerProperties.Experience; Properties.OnLevelChanged += LevelChanged_OnLevelChanged; Muscle.OnMuscleChanged += Muscle_OnMuscleChanged; Muscle.Attributes.OnClicksChanging += Muscle_ChangeClicks; }
public static void Init() { score = 0; highScore = SerializationSystem.GetValue <int>("highScore.json"); isBirdFly = false; isGameWaiting = true; highScoreLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontScore")); highScoreLabel.GetComponent().GetFontComponent().SetText(highScore.ToString()); highScoreLabel.GetComponent().GetTransformComponent().SetPosition(SEProperties.GetGameWindowWidth() / 2, SEProperties.GetGameWindowHeight() / 8); scoreLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontScore")); scoreLabel.GetComponent().GetFontComponent().SetText(score.ToString()); scoreLabel.GetComponent().GetTransformComponent().SetPosition(SEProperties.GetGameWindowWidth() / 2, SEProperties.GetGameWindowHeight() / 20); textLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontText")); textLabel.GetComponent().GetFontComponent().SetText("Tap on space to play game"); textLabel.GetComponent().GetTransformComponent().SetPosition(150, 400); groundHeigth = 450; }
public static Muscle MuscleLevelUp(Muscle muscle) { ZoomSystem.Detach(); Muscles .Where(x => x.Properties.TypeMuscle == muscle.Properties.TypeMuscle) .Where(x => x.Properties.MuscleLevel == muscle.Properties.MuscleLevel) .ToList() .ForEach(x => x.gameObject.SetActive(false)); Muscles .Where(x => x.Properties.TypeMuscle == muscle.Properties.TypeMuscle) .Where(x => x.Properties.MuscleLevel == muscle.Properties.MuscleLevel + 1) .ToList() .ForEach(x => x.gameObject.SetActive(true)); SerializationSystem.Save(PlayerAttributes.PlayerProperties); return(Muscles .Where(x => x.Properties.TypeMuscle == muscle.Properties.TypeMuscle) .First(x => x.gameObject.activeSelf)); }