add areaname

This commit is contained in:
Vova
2023-12-06 14:55:20 +02:00
parent 87595daf67
commit 487c0fabae
16 changed files with 408 additions and 60 deletions
@@ -0,0 +1,20 @@
using Assets.Scripts.Interfaces;
using UnityEngine;
public class AreaName : MonoBehaviour
{
[SerializeField]
private string _areaName;
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag.ToLower()=="player")
{
(Player.Instance.Stats[StatsId.LocationName] as IStringStat).SetValue(_areaName);
}
}
private void OnTriggerStay(Collider other)
{
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 18f0e472918ce7a41898514f037c380d
+2 -1
View File
@@ -1,4 +1,5 @@
using Assets.Scripts.Interfaces;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -49,7 +50,7 @@ public class Fridge : BaseInteractableObject
Debug.Log($"Fridge is full");
break;
case RadialMenuActions.Eat:
var hunger = _player.Stats[StatsId.Food].MaxValue - _player.Stats[StatsId.Food].Value;
var hunger = (_player.Stats[StatsId.Food] as INumericStat).MaxValue - (_player.Stats[StatsId.Food] as INumericStat).Value;
var eatingItems = _foodObjects.Count < (hunger / 10) ? _foodObjects.Count : (hunger / 10);
StartCoroutine(EatRoutine(eatingItems));
_foodObjects.RemoveRange(0, (int)eatingItems);