Esempio n. 1
0
    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;
    }
Esempio n. 2
0
    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));
    }