29 lines
674 B
C#
29 lines
674 B
C#
using System;
|
|
using System.Collections;
|
|
|
|
public class Bed : BaseInteractableObject
|
|
{
|
|
private Player _player;
|
|
|
|
public override void Interact(Player player)
|
|
{
|
|
_player=player;
|
|
StartCoroutine(Sleep());
|
|
}
|
|
|
|
private IEnumerator Sleep()
|
|
{
|
|
_player.SetPlayerAnimation(AnimationStates.Sitting);
|
|
yield return StartCoroutine(_player.IsAnimationStatePlaying(0));
|
|
print("sitting animation finished");
|
|
TimeManager.Instance.FastForward(TimeSpan.FromHours(8), OnFastForwardEnd);
|
|
|
|
yield break;
|
|
}
|
|
|
|
private void OnFastForwardEnd()
|
|
{
|
|
_player.SetPlayerAnimation(AnimationStates.Standing);
|
|
}
|
|
}
|