Irgendjemand musste es ja machen...
This commit is contained in:
@ -213,13 +213,16 @@ public class Character : MonoBehaviour
|
||||
switch (item.ItemType)
|
||||
{
|
||||
case ItemType.Coffee:
|
||||
developer.GiveDrink(0.4, WantedConsumable.Drink);
|
||||
developer.GiveDrink(0.45, WantedConsumable.Coffee);
|
||||
_audioSource.PlayOneShot(_data.DrinkCoffe);
|
||||
break;
|
||||
case ItemType.Mate:
|
||||
developer.GiveDrink(0.4, WantedConsumable.Mate);
|
||||
developer.GiveDrink(0.35, WantedConsumable.Mate);
|
||||
_audioSource.PlayOneShot(_data.DrinkMate);
|
||||
break;
|
||||
case ItemType.Pizza:
|
||||
developer.GiveFood(0.25, WantedConsumable.Pizza);
|
||||
developer.GiveFood(0.4, WantedConsumable.Pizza);
|
||||
_audioSource.PlayOneShot(_data.EatPizza);
|
||||
break;
|
||||
default:
|
||||
SayItsImpossible();
|
||||
@ -240,4 +243,25 @@ public class Character : MonoBehaviour
|
||||
{
|
||||
_audioSource.PlayOneShot(_data.VoiceSayItsImpossible.GetRandomElement());
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private bool _canHurt = true;
|
||||
|
||||
public void Hurt()
|
||||
{
|
||||
if (_canHurt)
|
||||
StartCoroutine(HurtRoutine());
|
||||
}
|
||||
|
||||
private IEnumerator HurtRoutine()
|
||||
{
|
||||
_canHurt = false;
|
||||
|
||||
_audioSource.PlayOneShot(_data.Hurt);
|
||||
PickupItem(null);
|
||||
|
||||
yield return new WaitForSeconds(1);
|
||||
|
||||
_canHurt = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user