Esempio n. 1
0
 /// <summary>
 /// Changes the time of the day to the specified one using the <see cref="DayNightManager"/>.
 /// </summary>
 protected override void OnInteract()
 {
     _playerController.DeactivateMovement();
     InteractDisabled = true;
     _playerController.SetAnimationBool(Consts.Animation.SLEEP_BOOL, true);
     DayNightManager.Instance.SetDayTimeWithAnimation(newTime, animationTime,
                                                      () =>
     {
         _playerController.SetAnimationBool(Consts.Animation.SLEEP_BOOL, false);
         _playerController.ActivateMovement();
         InteractDisabled        = false;
         PlayerState playerState = PlayerManager.Instance.GetPlayerState();
         playerState.ChangePlayerHealth(healValue);
         playerState.ChangePlayerSanity(sanityValue);
         playerState.ChangePlayerHydration(hydrationValue);
         playerState.ChangePlayerSaturation(saturationValue);
         SaveManager.Save();
     });
 }